C# 클래스 GSF.Communication.TlsClient

Represents a TCP-based communication client with SSL authentication and encryption.
상속: ClientBase
파일 보기 프로젝트 열기: GridProtectionAlliance/gsf 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
DefaultTrustedCertificatesPath string

Private Properties

프로퍼티 타입 설명
ConnectAsync void
DefaultLocalCertificateSelectionCallback System.Security.Cryptography.X509Certificates.X509Certificate
DumpPayloads void
LoadTrustedCertificates void
ProcessConnect void
ProcessIntegratedSecurityAuthentication void
ProcessReceivePayloadAware void
ProcessReceivePayloadUnaware void
ProcessSend void
ProcessTlsAuthentication void
ReceivePayloadAwareAsync void
ReceivePayloadUnawareAsync void
SendPayloadAsync void
TerminateConnection void

공개 메소드들

메소드 설명
ConnectAsync ( ) : WaitHandle

Connects the TlsClient to the server asynchronously.

Disconnect ( ) : void

When overridden in a derived class, disconnects client from the server synchronously.

LoadSettings ( ) : void

Loads saved TlsClient settings from the config file if the ClientBase.PersistSettings property is set to true.

Read ( byte buffer, int startIndex, int length ) : int

When overridden in a derived class, reads a number of bytes from the current received data buffer and writes those bytes into a byte array at the specified offset.

This function should only be called from within the ClientBase.ReceiveData event handler. Calling this method outside this event will have unexpected results.

SaveSettings ( ) : void

Saves TlsClient settings to the config file if the ClientBase.PersistSettings property is set to true.

TlsClient ( ) : System

Initializes a new instance of the TlsClient class.

TlsClient ( IContainer container ) : System

Initializes a new instance of the TlsClient class.

TlsClient ( string connectString ) : System

Initializes a new instance of the TlsClient class.

보호된 메소드들

메소드 설명
Dispose ( bool disposing ) : void

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

OnReceiveDataException ( Exception ex ) : void

Raises the ClientBase.ReceiveDataException event.

OnReceiveDataException ( SocketException ex ) : void

Raises the ClientBase.ReceiveDataException event.

OnSendDataException ( Exception ex ) : void

Raises the ClientBase.SendDataException event.

SendDataAsync ( byte data, int offset, int length ) : WaitHandle

When overridden in a derived class, sends data to the server asynchronously.

ValidateConnectionString ( string connectionString ) : void

When overridden in a derived class, validates the specified connectionString.

비공개 메소드들

메소드 설명
ConnectAsync ( ConnectState connectState ) : void

Initiates an asynchronous connection attempt.

DefaultLocalCertificateSelectionCallback ( object sender, string targetHost, X509CertificateCollection localCertificates, X509Certificate remoteCertificate, string acceptableIssuers ) : X509Certificate

Returns the certificate set by the user.

DumpPayloads ( ) : void

Dumps payloads from the send queue when the send queue grows too large.

LoadTrustedCertificates ( ) : void

Loads the list of trusted certificates into the default certificate checker.

ProcessConnect ( ConnectState connectState ) : void
ProcessIntegratedSecurityAuthentication ( IAsyncResult asyncResult ) : void
ProcessReceivePayloadAware ( IAsyncResult asyncResult ) : void

Callback method for asynchronous receive operation of payload data in "payload-aware" mode.

ProcessReceivePayloadUnaware ( IAsyncResult asyncResult ) : void

Callback method for asynchronous receive operation of payload data in "payload-unaware" mode.

ProcessSend ( IAsyncResult asyncResult ) : void

Callback method for asynchronous send operation.

ProcessTlsAuthentication ( IAsyncResult asyncResult ) : void

Callback method for asynchronous authenticate operation.

ReceivePayloadAwareAsync ( ReceiveState receiveState ) : void

Initiate method for asynchronous receive operation of payload data in "payload-aware" mode.

ReceivePayloadUnawareAsync ( ReceiveState receiveState ) : void

Initiate method for asynchronous receive operation of payload data in "payload-unaware" mode.

SendPayloadAsync ( SendState sendState ) : void

Sends a payload on the socket.

TerminateConnection ( CancellationToken cancellationToken ) : void

Processes the termination of client.

메소드 상세

ConnectAsync() 공개 메소드

Connects the TlsClient to the server asynchronously.
Attempt is made to connect the when it is not disconnected.
public ConnectAsync ( ) : WaitHandle
리턴 System.Threading.WaitHandle

Disconnect() 공개 메소드

When overridden in a derived class, disconnects client from the server synchronously.
public Disconnect ( ) : void
리턴 void

Dispose() 보호된 메소드

Releases the unmanaged resources used by the TlsClient and optionally releases the managed resources.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
리턴 void

LoadSettings() 공개 메소드

Loads saved TlsClient settings from the config file if the ClientBase.PersistSettings property is set to true.
public LoadSettings ( ) : void
리턴 void

OnReceiveDataException() 보호된 메소드

Raises the ClientBase.ReceiveDataException event.
protected OnReceiveDataException ( Exception ex ) : void
ex System.Exception Exception to send to event.
리턴 void

OnReceiveDataException() 보호된 메소드

Raises the ClientBase.ReceiveDataException event.
protected OnReceiveDataException ( SocketException ex ) : void
ex System.Net.Sockets.SocketException Exception to send to event.
리턴 void

OnSendDataException() 보호된 메소드

Raises the ClientBase.SendDataException event.
protected OnSendDataException ( Exception ex ) : void
ex System.Exception Exception to send to event.
리턴 void

Read() 공개 메소드

When overridden in a derived class, reads a number of bytes from the current received data buffer and writes those bytes into a byte array at the specified offset.
This function should only be called from within the ClientBase.ReceiveData event handler. Calling this method outside this event will have unexpected results.
public Read ( byte buffer, int startIndex, int length ) : int
buffer byte Destination buffer used to hold copied bytes.
startIndex int 0-based starting index into destination to begin writing data.
length int The number of bytes to read from current received data buffer and write into .
리턴 int

SaveSettings() 공개 메소드

Saves TlsClient settings to the config file if the ClientBase.PersistSettings property is set to true.
public SaveSettings ( ) : void
리턴 void

SendDataAsync() 보호된 메소드

When overridden in a derived class, sends data to the server asynchronously.
protected SendDataAsync ( byte data, int offset, int length ) : WaitHandle
data byte The buffer that contains the binary data to be sent.
offset int The zero-based position in the at which to begin sending data.
length int The number of bytes to be sent from starting at the .
리턴 System.Threading.WaitHandle

TlsClient() 공개 메소드

Initializes a new instance of the TlsClient class.
public TlsClient ( ) : System
리턴 System

TlsClient() 공개 메소드

Initializes a new instance of the TlsClient class.
public TlsClient ( IContainer container ) : System
container IContainer object that contains the .
리턴 System

TlsClient() 공개 메소드

Initializes a new instance of the TlsClient class.
public TlsClient ( string connectString ) : System
connectString string Connect string of the . See for format.
리턴 System

ValidateConnectionString() 보호된 메소드

When overridden in a derived class, validates the specified connectionString.
protected ValidateConnectionString ( string connectionString ) : void
connectionString string The connection string to be validated.
리턴 void

프로퍼티 상세

DefaultTrustedCertificatesPath 공개적으로 프로퍼티

Specifies the default value for the TrustedCertificatesPath property.
public string DefaultTrustedCertificatesPath
리턴 string