Hi i am new to visual basic..I have some knowledge about the winsocks in vbasic and i have succesfully made a chat program..Why am i saying all this?
Because i can't explain the problem i have..Ok here goes:
I have made a winsocket that listens to a specific port.The client can succesfully connect and i can see that when i accept the connection request..But when i try to receive the data the client sends i receive nothing, that is the DataArrival is never called..Here is the code part.I can't figure out what's the problem because i use the same code i used in my chat program![]()
VB Code:
Winsock23.LocalPort = 23 Winsock23.Listen Private Sub Winsock23_ConnectionRequest(ByVal requestID As Long) On Error Resume Next 'Now accept the Request Winsock23.Accept requestID txtEvent.Text = txtEvent.Text & vbCrLf & " connected" End Sub Private Sub Winsock23_DataArrival(ByVal bytesTotal As Long) Dim str As String MsgBox str Winsock23.GetData str, vbString End Sub
The msbox should at least display but nothing happens which means that i don't receive anything![]()
For the client i use
VB Code:
Winsock1.Connect txtIp.Text, 23 Winsock1.SendData "Test"
I don't think there's a client problem for not receiving anything right?
Anyway i would really appreciate any help because i am on the finishing touches of my project and i am really stuck![]()
![]()




Reply With Quote