-
March 24th, 2009, 01:31 PM
#1
Connect window xp to linux(udp socket programming)
Hi.
I'm new to vb6.
I want to transmit data between linux(C laguage) and window xp(vb6) with UDP socket.
I already used "winsock" in vb6, but data wasn't transmitted with linux server.
Do I need to make structure(sockaddr_in) in vb6 so that linux server can read it?
Or can I use this structure type without any declare in vb6?
Here's my VB6 code,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Code:
''''send data'''''''''''''''''''''''''''
Private Sub cmdSend_Click()
wsClient.SendData txtSend.Text
DisplayText "<Client> " & txtSend.Text
txtSend.Text = vbNullString
End Sub
.................
''''receive data'''''''''''''''''''''
Private Sub wsClient_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
wsClient.GetData strData, vbString
DisplayText "<Server> " & strData
End Sub
........
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
In order to receive/send data from/to this client(window, vb6),
how does Linux sever(C program) can do?
or
Does window client need to be change? How?
Please, it's urgent problem related with my research.
thanks.
-
March 24th, 2009, 01:41 PM
#2
Re: Connect window xp to linux(udp socket programming)
Sockets are Sockets. I have sent and received data from Linux servers before. There is no special programming that needs to be done. However, MOST linux servers are locked down now. That means you may not be able to listen for a connection on the linux server unless you allow incoming connections. Try using telnet to connect to the linux server from your PC. If that works, the winsock control should also work.
-
March 24th, 2009, 03:02 PM
#3
Re: Connect window xp to linux(udp socket programming)
I check the connection with telnet but it is not connected.
Do you know how can I connect it?
Do I have to open the port(telnet port : 23)?
In that case, I use another port in my program then I should open that port either?
thanks.
-
March 24th, 2009, 04:21 PM
#4
Re: Connect window xp to linux(udp socket programming)
You say you have a linux c program on the server/ What port is it listening on? Say it is on port 1054 then you try.
telnet 192.168.0.2 1054
telnet will then try to connect on that port. Since you are using UDP, you might get disconnected quickly. If you were using TCP, the connection would stay. I am not exactly sure how telnet will work with UDP.
Maybe you should find a port scanner and see if the port is open on the linux computer. When you are doing network programming, you need to start with taking all of the security issues into account before you can proceed. For example, do you have a firewall on the Windows PC that could be blocking the connection. Is tere a firewall on the Linux Server that could be blocking the connection. Is there a router in-between the computers that could be blocking the connection (a lot of home network routers will block ports). Once you are sure you actually can connect to the Linux server, then start on the programming.
Hope this helps.
-
March 24th, 2009, 06:54 PM
#5
Re: Connect window xp to linux(udp socket programming)
Pretty sure that you can't TELNET to anything with UDP packets, but I could be wrong
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|