Home > Software engineering > Why WINSOCK control server-side WINSOCK control carried out after the close event, the client of the
Why WINSOCK control server-side WINSOCK control carried out after the close event, the client of the
Time:09-26
Why WINSOCK control server-side WINSOCK control carried out after the close event, the client of the WINSOCK control tcpClient_Close constantly repeated execution,
The code is as follows:
Private Sub tcpServer_DataArrival (Index As an Integer, ByVal bytesTotal As Long) 'server receives a client sending a Q characters, the server to establish connections with the client of the WINSOCK control execution CLOSE operation, Dim sData As String Dim sName As String
If the sName="Q" Then tcpServer (Index). Close 'with this client connect WINSOCK control execution Close operation End the If
End Sub
Private Sub tcpClient_Close () 'execution on the server tcpServer (Index). After the Close of the client automatically produce tcpClient_Close events, and executed repeatedly
End Sub
Server side implementation tcpServer (Index). After the Close of the client automatically generated tcpClient_Close events, and perform repeatedly, normal should be performed once, just finished, why the repeated continuously perform it?
Thank you for your attention
CodePudding user response:
Best for all of the code, as such things look not to come out...
CodePudding user response:
Private Sub tcpClient_Close () TcpClient Close 'to add this sentence try again '... End Sub