Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21237

Winsock Error (wrong protocol or connection state for the requested transaction)

$
0
0
hello guys... i`m really need ur help...

i just want to make a client/ server using a winsock... everything is fine when i`m doing on my computer (client /server)
but THERE are problem when I try to connect to another computer..which is client from my computer and another computer is server...

here is coding for client :
Private Sub Command1_Click()
Winsock.Connect txtip.Text, txtport.Text
End Sub

Private Sub Form_Load()
txtip.Text = Winsock.RemoteHost
End Sub

Private Sub txtsend_Click()
Winsock.SendData txtmsg.Text
txtmsg.Text = ""
End Sub

Private Sub Winsock_DataArrival(ByVal bytesTotal As Long)
Winsock.GetData dataArrived, vbString

txtchat.Text = txtchat.Text & dataArrived & vbNewLine
End Sub


THIS IS FOR SERVER :
Private Sub Form_Load()
Winsock.Listen
End Sub

Private Sub txtsend_Click()
Winsock.SendData txtmsg.Text
txtmsg.Text = ""
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)
Winsock.GetData dataArrived, vbString

txtchat.Text = txtchat.DataChanged & dataArrived
End Sub

HERE I attached the files... please somebody help me, what is going on?...
Attached Files

Viewing all articles
Browse latest Browse all 21237

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>