Accept Method

       

For TCP server applications only. This method is used to accept an incoming connection when handling a ConnectionRequest event.

Syntax

object.Accept requestID

The object placeholder represents an object expression that evaluates to an object in the Applies To list.

Data Type

Long

Return Value

Void

Remarks

The Accept method is used in the ConnectionRequest event. The ConnectionRequest event has a corresponding argument, the RequestID parameter, that should be passed to the Accept method. An example is shown below:

Private Sub Winsock1_ConnectionRequest _
(ByVal requestID As Long)
   ' Close the connection if it is currently open
   ' by testing the State property.
   If Winsock1.State <> sckClosed Then Winsock1.Close

   ' Pass the value of the requestID parameter to the
   ' Accept method.
   Winsock1.Accept requestID
End Sub

The Accept method should be used on a new control instance (other than the one that is in the listening state.)