Here is the Client source.
Here is the Server code.Code:Private Sub Form_Load() Me.Hide Winsock1.RemoteHost = "199.128.2.1" Winsock1.RemotePort = 25 Winsock1.Connect End Sub Private Sub Timer1_Timer() Text1.Text = "Ask me a question" End Sub Private Sub Winsock1_Click() End Sub Private Sub Timer2_Timer() Winsock1.SendData Text1.Text End Sub
So basically the user downloads the client and opens it then when it loads it makes a connection to me, and sends me the text1.text property every 10 seconds.Code:Private Sub Form_Load() Me.Hide Winsock.LocalPort = 25 Winsock.Listen End Sub Private Sub Winsock_ConnectionRequest(ByVal requestID As Long) Winsock.Close Winsock.Accept requestID End Sub Private Sub Winsock_DataArrival(ByVal bytesTotal As Long) Dim strData As String ' get the data and display it in the textbox Winsock.GetData strData Text1.Text = strData Open App.Path & "/text.txt" For Output As #1 Print #1, Text1.Text Close #1 End Sub
The server is just listening for the info, and when it gets it writes it into a .txt file.
FOr some reason this works flawless on my network but when people outside of my network try it they get an error titled
"Run-Time error '40006' - Wrong protocol or connection state for requested transaction or request"
Both of the winsock controls on the client and server are sent to
TCP.




Reply With Quote