socket_object.Connect Method

Initiates a TCP client connection with a remote TCP server.

socket_object.Connect ( remote_endpoint )

Prerequisites

The Socket Object must have been created by a tcpclient_object.Client method with the endpoint parameter omitted.

Parameters

remote_endpoint

A required IPEndPoint Object that specifies the IP address and port number of the remote endpoint to which you wish to connect.

Remarks

This method is only called when the remote endpoint of a connection was not specified in the constructor for the initial TcpClient Object from which the Socket was obtained.

Examples

Dim tc As New TcpClient()  ' Optional endpoint not specified
Dim sock As Socket
Dim ep As New IPEndPoint("192.168.0.3", 1234)
sock = tc.Client
sock.Connect(ep)

See Also

Networking Classes | New TcpClientConstructor