Home > Software engineering > When using a SOCKET on the client side a REQUESTID CONNCET request is on the server side a SOCKET co
When using a SOCKET on the client side a REQUESTID CONNCET request is on the server side a SOCKET co
Time:09-22
A, the following code Private Sub tcpServer_ConnectionRequest (ByVal requestID As Long) On Error GoTo Errc
ServerSock1 (0). The Accept requestID ServerSock1 (1). The Accept requestID
The Exit Sub Errc: MsgBox Err. The Description & amp; "Id:" & amp; Err. Number & amp; SOURCE: "" & amp; Err. Source End Sub
Why a client CONNECT requests are ServerSock1 (0) after receiving (Accept), ServerSock1 (1) the Accept can also perform well?
After more than two, code execution on the server sends the message Private Sub Command1_Click () ServerSock1 (0). SendData publishes the event "message from (0)" End Sub
Private Sub Command2_Click () ServerSock1 (1). SendData publishes the event "message from (1)" End Sub
The client receives the code Private Sub CLientSock_DataArrival (ByVal bytesTotal As Long)
Dim S As String CLientSock. GetData S
End Sub
After Command1_ Click execute CLientSock _DataArrival did not receive the message Command2_ Click execute CLientSock_DataArrival after receiving the message
Why ServerSock1 (0), the client is not received?
CodePudding user response:
Is covered, the real work of only Accept after ServerSock1 (1), From the function, twice the Accept belong to the error code,