Share via


Visual Basic: Winsock Control

Accept Method, ConnectionRequest Event Example

The example shows the code necessary to connect a Winsock control using the TCP protocol. The code runs on the machine that is accepting the connection request. The RequestID parameter identifies the request. This is passed to the Accept method which accepts the particular request.

  Private Sub WinsockTCP_ConnectionRequest _
(requestID As Long)
   If Winsock1.State <> sckClosed Then Winsock1.Close
   Winsock.Accept requestID
End Sub