-
I can't make a connect between to computers! The winsock state is 6...I can't make it go 7!
This is the program, which is sending data:
Code:
Private Sub cmdSend_Click()
On Error GoTo error
Debug.Print Winsock1.State
Winsock1.SendData SendData.Text
Exit Sub
error:
MsgBox "Error!"
End Sub
Private Sub Form_Load()
Winsock1.Connect "1.0.0.2"
Debug.Print Winsock1.State
End Sub
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
Winsock1.Bind
End Sub
This is the program, which is recieving the data:
Code:
Private Sub Command1_Click()
On Error GoTo error
Winsock1.Bind
Exit Sub
error:
MsgBox "Error!"
End Sub
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
Winsock1.Bind
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim Data
Winsock1.GetData Data, vbString
MsgBox Data
End Sub
What is wrong???
-
Hiya there,
Ok... This is my first time in replying to a post so I hope I'm making this right...
I would use the connection oriented strucutre to transmit your data.
On the computer that is receiving the data, you should have something like :
Code:
Private Sub Form_Load()
Winsock1.Listen
Debug.Print Winsock1.State
End Sub
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
Winsock1.Accept requestID
End Sub
I dont know much about the bind method but I hope this solves the problem,
Best regards,
COOLHP.