I am trying to get two apps to work together. One that will send a message, using winsock, from one IP address to another. And a second that listens for the message, using winsock, and records it in a file. I have this setup working across our network (Intranet) but I can't get it to work over the internet.
I guess I have a couple of questions. First is Winsock the right tool for the job? If not what is? If it is the right tool, what do I need to do to make it work over the internet.
I am not getting any errors, just that the connection failed. Below is the code that I am using and both apps winsock controls are listening to the same port.
If Winsock1.State = sckConnected Then Winsock1.Close
Winsock1.RemoteHost = m_strIPAddress
Winsock1.RemotePort = 1001
Winsock1.Connect
Do Until Winsock1.State = sckConnected
DoEvents: DoEvents: DoEvents: DoEvents
If Winsock1.State = sckError Then
Msgbox "Connection failed!"
Winsock1.Close
Exit Sub
End If
Loop
Winsock1.SendData txtMessage.Text
Thanks and Good Luck!
zemp
I guess I have a couple of questions. First is Winsock the right tool for the job? If not what is? If it is the right tool, what do I need to do to make it work over the internet.
I am not getting any errors, just that the connection failed. Below is the code that I am using and both apps winsock controls are listening to the same port.
If Winsock1.State = sckConnected Then Winsock1.Close
Winsock1.RemoteHost = m_strIPAddress
Winsock1.RemotePort = 1001
Winsock1.Connect
Do Until Winsock1.State = sckConnected
DoEvents: DoEvents: DoEvents: DoEvents
If Winsock1.State = sckError Then
Msgbox "Connection failed!"
Winsock1.Close
Exit Sub
End If
Loop
Winsock1.SendData txtMessage.Text
Thanks and Good Luck!
zemp