C# Class Opc.Ua.Bindings.TcpClientChannel

Manages the client side of a UA TCP channel.
Inheritance: TcpChannel
ファイルを表示 Open project: OPCFoundation/UA-.NETStandardLibrary Class Usage Examples

Public Methods

Method Description
BeginConnect ( Uri url, int timeout, AsyncCallback callback, object state ) : IAsyncResult

Creates a connection with the server.

BeginSendRequest ( IServiceRequest request, int timeout, AsyncCallback callback, object state ) : IAsyncResult

Sends a request to the server.

Close ( int timeout ) : void

Closes a connection with the server.

EndConnect ( IAsyncResult result ) : void

Finishes a connect operation.

EndSendRequest ( IAsyncResult result ) : IServiceResponse

Returns the response to a previously sent request.

TcpClientChannel ( string contextId, BufferManager bufferManager, TcpChannelQuotas quotas, X509Certificate2 clientCertificate, X509Certificate2 serverCertificate, EndpointDescription endpoint ) : System

Creates a channel for for a client.

Protected Methods

Method Description
HandleIncomingMessage ( uint messageType, ArraySegment messageChunk ) : bool

Processes an incoming message.

HandleSocketError ( ServiceResult result ) : void

Handles a socket error.

HandleWriteComplete ( BufferCollection buffers, object state, int bytesWritten, ServiceResult result ) : void

Called when a write operation completes.

ProcessErrorMessage ( uint messageType, ArraySegment messageChunk ) : bool

Processes an Error message received over the socket.

Private Methods

Method Description
BeginOperation ( int timeout, AsyncCallback callback, object state ) : WriteOperation

Creates a object to manage the state of an asynchronous operation.

Dispose ( bool disposing ) : void
ForceReconnect ( ServiceResult reason ) : void

Closes the channel and attempts to reconnect.

OnConnectComplete ( object sender, SocketAsyncEventArgs e ) : void

Called when the socket is connected.

OnConnectOnDemandComplete ( object state ) : void

Called when the connect operation completes.

OnHandshakeComplete ( IAsyncResult result ) : void

Called when a token is renewed.

OnScheduledHandshake ( object state ) : void

Called when it is time to do a handshake.

OperationCompleted ( WriteOperation operation ) : void

Cleans up after an asychronous operation completes.

ParseResponse ( BufferCollection chunksToProcess ) : IServiceResponse

Parses the response return from the server.

ProcessAcknowledgeMessage ( ArraySegment messageChunk ) : bool
ProcessOpenSecureChannelResponse ( uint messageType, ArraySegment messageChunk ) : bool

Processes an OpenSecureChannel response message.

ProcessResponseMessage ( uint messageType, ArraySegment messageChunk ) : bool

Processes a response message.

ScheduleTokenRenewal ( TcpChannelToken token ) : void

Schedules the renewal of a token.

SendCloseSecureChannelRequest ( WriteOperation operation ) : void

Sends an CloseSecureChannel request message.

SendHelloMessage ( WriteOperation operation ) : void

Sends a Hello message.

SendOpenSecureChannelRequest ( bool renew ) : void

Sends an OpenSecureChannel request.

SendRequest ( WriteOperation operation, int timeout, IServiceRequest request ) : void

Sends a request to the server.

Shutdown ( ServiceResult reason ) : void

Cancels all pending requests and closes the channel.

Method Details

BeginConnect() public method

Creates a connection with the server.
public BeginConnect ( Uri url, int timeout, AsyncCallback callback, object state ) : IAsyncResult
url System.Uri
timeout int
callback AsyncCallback
state object
return IAsyncResult

BeginSendRequest() public method

Sends a request to the server.
public BeginSendRequest ( IServiceRequest request, int timeout, AsyncCallback callback, object state ) : IAsyncResult
request IServiceRequest
timeout int
callback AsyncCallback
state object
return IAsyncResult

Close() public method

Closes a connection with the server.
public Close ( int timeout ) : void
timeout int
return void

EndConnect() public method

Finishes a connect operation.
public EndConnect ( IAsyncResult result ) : void
result IAsyncResult
return void

EndSendRequest() public method

Returns the response to a previously sent request.
public EndSendRequest ( IAsyncResult result ) : IServiceResponse
result IAsyncResult
return IServiceResponse

HandleIncomingMessage() protected method

Processes an incoming message.
protected HandleIncomingMessage ( uint messageType, ArraySegment messageChunk ) : bool
messageType uint
messageChunk ArraySegment
return bool

HandleSocketError() protected method

Handles a socket error.
protected HandleSocketError ( ServiceResult result ) : void
result ServiceResult
return void

HandleWriteComplete() protected method

Called when a write operation completes.
protected HandleWriteComplete ( BufferCollection buffers, object state, int bytesWritten, ServiceResult result ) : void
buffers BufferCollection
state object
bytesWritten int
result ServiceResult
return void

ProcessErrorMessage() protected method

Processes an Error message received over the socket.
protected ProcessErrorMessage ( uint messageType, ArraySegment messageChunk ) : bool
messageType uint
messageChunk ArraySegment
return bool

TcpClientChannel() public method

Creates a channel for for a client.
public TcpClientChannel ( string contextId, BufferManager bufferManager, TcpChannelQuotas quotas, X509Certificate2 clientCertificate, X509Certificate2 serverCertificate, EndpointDescription endpoint ) : System
contextId string
bufferManager BufferManager
quotas TcpChannelQuotas
clientCertificate System.Security.Cryptography.X509Certificates.X509Certificate2
serverCertificate System.Security.Cryptography.X509Certificates.X509Certificate2
endpoint EndpointDescription
return System