C# Class org.GraphDefined.Vanaheimr.Hermod.Sockets.TCP.TCPClient

Exibir arquivo Open project: Vanaheimr/Hermod

Public Properties

Property Type Description
_ConnectionTimeout System.TimeSpan

Public Methods

Method Description
Connect ( ) : TCPConnectResult
Disconnect ( ) : TCPDisconnectResult
TCPClient ( String RemoteHost, IPPort RemotePort, System.Boolean UseIPv4 = true, System.Boolean UseIPv6 = false, System.Boolean PreferIPv6 = false, TLSUsage UseTLS = TLSUsage.STARTTLS, ValidateRemoteCertificateDelegate ValidateServerCertificate = null, System.TimeSpan ConnectionTimeout = null, DNSClient DNSClient = null, System.Boolean AutoConnect = false, CancellationToken CancellationToken = null ) : System

TCPClient ( String DNSName = "", String ServiceName = "", System.Boolean UseIPv4 = true, System.Boolean UseIPv6 = false, System.Boolean PreferIPv6 = false, System.Boolean UseTLS = false, System.TimeSpan ConnectionTimeout = null, DNSClient DNSClient = null, System.Boolean AutoConnect = false ) : System

Create a new TCPClient connecting to a remote service using DNS SRV records.

Protected Methods

Method Description
EnableTLS ( ) : void

Private Methods

Method Description
CreateAndConnectTCPSocket ( IIPAddress _IPAddress, IPPort Port ) : Socket
QueryDNS ( ) : void
Reconnect ( ) : System.Boolean
_ValidateRemoteCertificate ( Object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors ) : System.Boolean

Method Details

Connect() public method

public Connect ( ) : TCPConnectResult
return TCPConnectResult

Disconnect() public method

public Disconnect ( ) : TCPDisconnectResult
return TCPDisconnectResult

EnableTLS() protected method

protected EnableTLS ( ) : void
return void

TCPClient() public method

public TCPClient ( String RemoteHost, IPPort RemotePort, System.Boolean UseIPv4 = true, System.Boolean UseIPv6 = false, System.Boolean PreferIPv6 = false, TLSUsage UseTLS = TLSUsage.STARTTLS, ValidateRemoteCertificateDelegate ValidateServerCertificate = null, System.TimeSpan ConnectionTimeout = null, DNSClient DNSClient = null, System.Boolean AutoConnect = false, CancellationToken CancellationToken = null ) : System
RemoteHost String
RemotePort IPPort
UseIPv4 System.Boolean Whether to use IPv4 as networking protocol.
UseIPv6 System.Boolean Whether to use IPv6 as networking protocol.
PreferIPv6 System.Boolean Prefer IPv6 (instead of IPv4) as networking protocol.
UseTLS TLSUsage Whether Transport Layer Security should be used or not.
ValidateServerCertificate ValidateRemoteCertificateDelegate A callback for validating the remote server certificate.
ConnectionTimeout System.TimeSpan The timeout connecting to the remote service.
DNSClient DNSClient An optional DNS client used to resolve DNS names.
AutoConnect System.Boolean Connect to the TCP service automatically on startup. Default is false.
CancellationToken System.Threading.CancellationToken
return System

TCPClient() public method

Create a new TCPClient connecting to a remote service using DNS SRV records.
public TCPClient ( String DNSName = "", String ServiceName = "", System.Boolean UseIPv4 = true, System.Boolean UseIPv6 = false, System.Boolean PreferIPv6 = false, System.Boolean UseTLS = false, System.TimeSpan ConnectionTimeout = null, DNSClient DNSClient = null, System.Boolean AutoConnect = false ) : System
DNSName String The optional DNS name of the remote service to connect to.
ServiceName String The optional DNS SRV service name of the remote service to connect to.
UseIPv4 System.Boolean Whether to use IPv4 as networking protocol.
UseIPv6 System.Boolean Whether to use IPv6 as networking protocol.
PreferIPv6 System.Boolean Prefer IPv6 (instead of IPv4) as networking protocol.
UseTLS System.Boolean
ConnectionTimeout System.TimeSpan The timeout connecting to the remote service.
DNSClient DNSClient An optional DNS client used to resolve DNS names.
AutoConnect System.Boolean Connect to the TCP service automatically on startup. Default is false.
return System

Property Details

_ConnectionTimeout public_oe property

public TimeSpan,System _ConnectionTimeout
return System.TimeSpan