cnjmorris
May 24th, 2001, 02:29 AM
Private Sub cmdConnect_Click()
wsS(0).Close
wsS(0).RemotePort = 600
wsS(0).Connect ConnectTo.Text
End Sub
Private Sub Form_Load()
If OpenAsServer = True Then
'Do Server Stuff
Frame1.Enabled = True
Text1.Text = wsS(0).LocalIP
Else
'Do Client Stuff
Frame2.Enabled = True
wsC.Listen
Text2.Text = wsC.LocalIP
wsC.Close
wsC.LocalPort = 600
wsC.Listen
End If
End Sub
Private Sub wsC_Connect()
Text3.Text = wsC.RemoteHostIP
End Sub
Private Sub wsC_ConnectionRequest(ByVal requestID As Long)
wsC.Accept requestID
End Sub
_______________________________________________
One form acts as server and client. When one computer tries to connect to the other I get an error. I must be overlooking something.
That is my code. I am getting this error:
"Run-time error '40020': Invalid operation at current state"
wsS(0).Close
wsS(0).RemotePort = 600
wsS(0).Connect ConnectTo.Text
End Sub
Private Sub Form_Load()
If OpenAsServer = True Then
'Do Server Stuff
Frame1.Enabled = True
Text1.Text = wsS(0).LocalIP
Else
'Do Client Stuff
Frame2.Enabled = True
wsC.Listen
Text2.Text = wsC.LocalIP
wsC.Close
wsC.LocalPort = 600
wsC.Listen
End If
End Sub
Private Sub wsC_Connect()
Text3.Text = wsC.RemoteHostIP
End Sub
Private Sub wsC_ConnectionRequest(ByVal requestID As Long)
wsC.Accept requestID
End Sub
_______________________________________________
One form acts as server and client. When one computer tries to connect to the other I get an error. I must be overlooking something.
That is my code. I am getting this error:
"Run-time error '40020': Invalid operation at current state"