C# Class Org.Mentalis.Security.Ssl.SecureTcpClient

Provides secure client connections for TCP network services.
Mostrar archivo Open project: soywiz/csharputils Class Usage Examples

Public Methods

Method Description
Close ( ) : void

Closes the TCP connection.

Connect ( IPAddress address, int port ) : void

Connects the client to a remote TCP host using the specified IP address and port number.

Connect ( IPEndPoint remoteEP ) : void

Connects the client to a remote TCP host using the specified remote network endpoint.

Connect ( string hostname, int port ) : void

Connects the client to the specified port on the specified host.

GetStream ( ) : Org.Mentalis.Security.Ssl.SecureNetworkStream

Returns the stream used to send and receive data.

SecureTcpClient ( ) : System

Initializes a new instance of the SecureTcpClient class.

The default constructor initializes a new SecureTcpClient. You must call the Connect method to establish a remote host connection.

SecureTcpClient ( IPEndPoint localEP ) : System

Initializes a new instance of SecureTcpClient bound to the specified local endpoint.

SecureTcpClient ( IPEndPoint localEP, Org.Mentalis.Security.Ssl.SecurityOptions options ) : System

Initializes a new instance of SecureTcpClient bound to the specified local endpoint.

SecureTcpClient ( SecureTcpClient client ) : System

Create a new SecureTcpClient based on an existing one.

SecureTcpClient ( Org.Mentalis.Security.Ssl.SecurityOptions options ) : System

Initializes a new instance of the SecureTcpClient class.

SecureTcpClient ( string hostname, int port ) : System

Initializes a new instance of the SecureTcpClient class and connects to the specified port on the specified host.

SecureTcpClient ( string hostname, int port, Org.Mentalis.Security.Ssl.SecurityOptions options ) : System

Initializes a new instance of the SecureTcpClient class and connects to the specified port on the specified host.

Protected Methods

Method Description
Dispose ( ) : void

Releases the unmanaged resources used by the SecureTcpClient and optionally releases the managed resources.

Private Methods

Method Description
SecureTcpClient ( SecureSocket socket ) : System

Initializes a new instance of SecureTcpClient.

This constructor is used by the SecureTcpListener class.

Method Details

Close() public method

Closes the TCP connection.
An error occurs while closing the Socket.
public Close ( ) : void
return void

Connect() public method

Connects the client to a remote TCP host using the specified IP address and port number.
The parameter is a null reference (Nothing in Visual Basic). is less than MinPort -or- is greater than MaxPort. An operating system error occurs while accessing the Socket. The has been closed. The security negotiation failed.
public Connect ( IPAddress address, int port ) : void
address System.Net.IPAddress The IP address of the host to which you intend to connect.
port int The port number to which you intend to connect.
return void

Connect() public method

Connects the client to a remote TCP host using the specified remote network endpoint.
The parameter is a null reference (Nothing in Visual Basic). An operating system error occurs while accessing the Socket. The has been closed. The security negotiation failed.
public Connect ( IPEndPoint remoteEP ) : void
remoteEP System.Net.IPEndPoint The IP endpoint to which you intend to connect.
return void

Connect() public method

Connects the client to the specified port on the specified host.
The parameter is a null reference (Nothing in Visual Basic). is less than MinPort -or- is greater than MaxPort. An operating system error occurs while accessing the Socket. The has been closed. The security negotiation failed.
public Connect ( string hostname, int port ) : void
hostname string The DNS name of the remote host to which you intend to connect.
port int The port number of the remote host to which you intend to connect.
return void

Dispose() protected method

Releases the unmanaged resources used by the SecureTcpClient and optionally releases the managed resources.
protected Dispose ( ) : void
return void

GetStream() public method

Returns the stream used to send and receive data.
The has been closed. The SecureTcpClient is not connected to a remote host.
public GetStream ( ) : Org.Mentalis.Security.Ssl.SecureNetworkStream
return Org.Mentalis.Security.Ssl.SecureNetworkStream

SecureTcpClient() public method

Initializes a new instance of the SecureTcpClient class.
The default constructor initializes a new SecureTcpClient. You must call the Connect method to establish a remote host connection.
public SecureTcpClient ( ) : System
return System

SecureTcpClient() public method

Initializes a new instance of SecureTcpClient bound to the specified local endpoint.
is null (Nothing in Visual Basic). An operating system error occurs while accessing the Socket.
public SecureTcpClient ( IPEndPoint localEP ) : System
localEP System.Net.IPEndPoint The IPEndPoint to which you bind the TCP Socket.
return System

SecureTcpClient() public method

Initializes a new instance of SecureTcpClient bound to the specified local endpoint.
is null (Nothing in Visual Basic). An operating system error occurs while accessing the Socket.
public SecureTcpClient ( IPEndPoint localEP, Org.Mentalis.Security.Ssl.SecurityOptions options ) : System
localEP System.Net.IPEndPoint The IPEndPoint to which you bind the TCP Socket.
options Org.Mentalis.Security.Ssl.SecurityOptions The security options to use.
return System

SecureTcpClient() public method

Create a new SecureTcpClient based on an existing one.
public SecureTcpClient ( SecureTcpClient client ) : System
client SecureTcpClient The SecureTcpClient to copy from.
return System

SecureTcpClient() public method

Initializes a new instance of the SecureTcpClient class.
public SecureTcpClient ( Org.Mentalis.Security.Ssl.SecurityOptions options ) : System
options Org.Mentalis.Security.Ssl.SecurityOptions The security options to use.
return System

SecureTcpClient() public method

Initializes a new instance of the SecureTcpClient class and connects to the specified port on the specified host.
is null (Nothing in Visual Basic). is less than MinPort -or- is greater than MaxPort. An error is encountered when resolving
-or-

an error occurred while connecting to the remote host.
The security negotiation failed.
public SecureTcpClient ( string hostname, int port ) : System
hostname string DNS name of the remote host to which you intend to connect.
port int Port number of the remote host to which you intend to connect.
return System

SecureTcpClient() public method

Initializes a new instance of the SecureTcpClient class and connects to the specified port on the specified host.
is null (Nothing in Visual Basic). is less than MinPort -or- is greater than MaxPort. An error is encountered when resolving -or- an error occurred while connecting to the remote host. The security negotiation failed.
public SecureTcpClient ( string hostname, int port, Org.Mentalis.Security.Ssl.SecurityOptions options ) : System
hostname string DNS name of the remote host to which you intend to connect.
port int Port number of the remote host to which you intend to connect.
options Org.Mentalis.Security.Ssl.SecurityOptions The security options to use.
return System