Connects the client to the specified port on the specified host.
[Visual Basic] Overloads Public Function Connect( _ ByVal hostname As String, _ ByVal port As Integer _ ) As Integer [C#] public int Connect( string hostname, int port ); [C++] public: int Connect( String* hostname, int port ); [JScript] public function Connect( hostname : String, port : int ) : int;
0 if the connection was successful; otherwise, a non-zero error code.
Connect establishes a TCP connection to the port and hostname specified. The connection is made using the Connect method of the underlying Socket instance.
TCPClient Class | TCPClient Members | System.Net.Sockets Namespace | TCPClient.Connect Overload List | Connect