C# Class Opc.Ua.Bindings.TcpServerChannel

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

Public Methods

Method Description
Attach ( uint channelId, Socket socket ) : void

Attaches the channel to an existing socket.

Reconnect ( TcpMessageSocket socket, uint requestId, uint sequenceNumber, X509Certificate2 clientCertificate, TcpChannelToken token, OpenSecureChannelRequest request ) : void

Handles a reconnect request.

SendResponse ( uint requestId, IServiceResponse response ) : void

Sends the response for the specified request.

SetRequestReceivedCallback ( TcpChannelRequestEventHandler callback ) : void

Sets the callback used to receive notifications of new events.

TcpServerChannel ( string contextId, UaTcpChannelListener listener, BufferManager bufferManager, TcpChannelQuotas quotas, X509Certificate2 serverCertificate, EndpointDescriptionCollection endpoints ) : System

Attaches the object to an existing socket.

Protected Methods

Method Description
ForceChannelFault ( Exception exception, uint defaultCode, string format ) : void

Forces the channel into a faulted state as a result of a fatal error.

ForceChannelFault ( ServiceResult reason ) : void

Forces the channel into a faulted state as a result of a fatal error.

ForceChannelFault ( uint statusCode, string format ) : void

Forces the channel into a faulted state as a result of a fatal error.

GetNewTokenId ( ) : uint

Returns a new token id.

HandleIncomingMessage ( uint messageType, ArraySegment messageChunk ) : bool

Processes an incoming message.

HandleSocketError ( ServiceResult result ) : void

Handles a socket error.

SendErrorMessage ( ServiceResult error ) : void

Sends an error message over the socket.

Private Methods

Method Description
ChannelClosed ( ) : void

Closes the channel and releases resources.

Dispose ( bool disposing ) : void
OnChannelReconnected ( object state ) : void

Called to send queued responses after a reconnect.

OnCleanup ( object state ) : void

Called when the channel needs to be cleaned up.

ProcessCloseSecureChannelRequest ( uint messageType, ArraySegment messageChunk ) : bool

Processes an CloseSecureChannel request message.

ProcessHelloMessage ( uint messageType, ArraySegment messageChunk ) : bool
ProcessOpenSecureChannelRequest ( uint messageType, ArraySegment messageChunk ) : bool

Processes an OpenSecureChannel request message.

ProcessRequestMessage ( uint messageType, ArraySegment messageChunk ) : bool

Processes a request message.

SendOpenSecureChannelResponse ( uint requestId, TcpChannelToken token, OpenSecureChannelRequest request ) : void

Sends an OpenSecureChannel response.

SendServiceFault ( TcpChannelToken token, uint requestId, ServiceResult fault ) : void

Sends a fault response secured with the symmetric keys.

SendServiceFault ( uint requestId, ServiceResult fault ) : void

Sends a fault response secured with the asymmetric keys.

StartCleanupTimer ( ServiceResult reason ) : void

Starts a timer that will clean up the channel if it is not opened/re-opened.

Method Details

Attach() public method

Attaches the channel to an existing socket.
public Attach ( uint channelId, Socket socket ) : void
channelId uint
socket Socket
return void

ForceChannelFault() protected method

Forces the channel into a faulted state as a result of a fatal error.
protected ForceChannelFault ( Exception exception, uint defaultCode, string format ) : void
exception System.Exception
defaultCode uint
format string
return void

ForceChannelFault() protected method

Forces the channel into a faulted state as a result of a fatal error.
protected ForceChannelFault ( ServiceResult reason ) : void
reason ServiceResult
return void

ForceChannelFault() protected method

Forces the channel into a faulted state as a result of a fatal error.
protected ForceChannelFault ( uint statusCode, string format ) : void
statusCode uint
format string
return void

GetNewTokenId() protected method

Returns a new token id.
protected GetNewTokenId ( ) : uint
return uint

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

Reconnect() public method

Handles a reconnect request.
public Reconnect ( TcpMessageSocket socket, uint requestId, uint sequenceNumber, X509Certificate2 clientCertificate, TcpChannelToken token, OpenSecureChannelRequest request ) : void
socket TcpMessageSocket
requestId uint
sequenceNumber uint
clientCertificate System.Security.Cryptography.X509Certificates.X509Certificate2
token TcpChannelToken
request OpenSecureChannelRequest
return void

SendErrorMessage() protected method

Sends an error message over the socket.
protected SendErrorMessage ( ServiceResult error ) : void
error ServiceResult
return void

SendResponse() public method

Sends the response for the specified request.
public SendResponse ( uint requestId, IServiceResponse response ) : void
requestId uint
response IServiceResponse
return void

SetRequestReceivedCallback() public method

Sets the callback used to receive notifications of new events.
public SetRequestReceivedCallback ( TcpChannelRequestEventHandler callback ) : void
callback TcpChannelRequestEventHandler
return void

TcpServerChannel() public method

Attaches the object to an existing socket.
public TcpServerChannel ( string contextId, UaTcpChannelListener listener, BufferManager bufferManager, TcpChannelQuotas quotas, X509Certificate2 serverCertificate, EndpointDescriptionCollection endpoints ) : System
contextId string
listener UaTcpChannelListener
bufferManager BufferManager
quotas TcpChannelQuotas
serverCertificate System.Security.Cryptography.X509Certificates.X509Certificate2
endpoints EndpointDescriptionCollection
return System