Visual Basic: Winsock Control

ConnectionRequest Event

See Also    Example    Applies To

Occurs when a remote machine requests a connection.

  • For TCP server applications only. The event is activated when there is an incoming connection request. RemoteHostIP and RemotePort properties store the information about the client after the event is activated.

Syntax

object_ConnectionRequest (requestID As Long*)*

The ConnectionRequest event syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
requestID The incoming connection request identifier. This argument should be passed to the Accept method on the second control instance.

Remarks

The server can decide whether or not to accept the connection. If the incoming connection is not accepted, the peer (client) will get the Close event. Use the Accept method (on a new control instance) to accept an incoming connection.