C# 클래스 GSF.Communication.ZeroMQServer

Represents a ZeroMQ ROUTER style socket as a communication server.
상속: ServerBase
파일 보기 프로젝트 열기: GridProtectionAlliance/gsf 1 사용 예제들

Private Properties

프로퍼티 타입 설명
GetClient TransportProvider
IsThreadAbortException bool
MonitorActiveClients void
ReceiveDataHandler void

공개 메소드들

메소드 설명
DisconnectOne ( System.Guid clientID ) : void

Disconnects the specified connected client.

LoadSettings ( ) : void

Loads saved ZeroMQServer settings from the config file if the ServerBase.PersistSettings property is set to true.

Read ( System.Guid clientID, byte buffer, int startIndex, int length ) : int

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 ServerBase.ReceiveClientData event handler. Calling this method outside this event will have unexpected results.

SaveSettings ( ) : void

Saves ZeroMQServer settings to the config file if the ServerBase.PersistSettings property is set to true.

Start ( ) : void

Starts the ZeroMQServer synchronously and begins accepting client connections asynchronously.

Stop ( ) : void

Stops the ZeroMQServer synchronously and disconnects all connected clients.

TryGetClient ( System.Guid clientID, TransportProvider &clientInfo ) : bool

Gets the TransportProvider{Socket} object associated with the specified client ID.

ZeroMQServer ( ) : System

Initializes a new instance of the ZeroMQServer class.

ZeroMQServer ( IContainer container ) : System

Initializes a new instance of the ZeroMQServer class.

ZeroMQServer ( string configString ) : System

Initializes a new instance of the ZeroMQServer class.

보호된 메소드들

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

Releases the unmanaged resources used by the ZeroMQServer object and optionally releases the managed resources.

OnClientConnectingException ( Exception ex ) : void

Raises the ServerBase.ClientConnectingException event.

OnReceiveClientDataException ( System.Guid clientID, Exception ex ) : void

Raises the ServerBase.ReceiveClientDataException event.

OnSendClientDataException ( System.Guid clientID, Exception ex ) : void

Raises the ServerBase.SendClientDataException event.

OnUnhandledUserException ( Exception ex ) : void

Raises the ServerBase.UnhandledUserException event.

SendDataToAsync ( System.Guid clientID, byte data, int offset, int length ) : WaitHandle

Sends data to the specified client asynchronously.

ValidateConfigurationString ( string configurationString ) : void

Validates the specified configurationString.

비공개 메소드들

메소드 설명
GetClient ( System.Guid clientID ) : TransportProvider
IsThreadAbortException ( Exception ex ) : bool
MonitorActiveClients ( object state ) : void
ReceiveDataHandler ( ) : void

메소드 상세

DisconnectOne() 공개 메소드

Disconnects the specified connected client.
Client does not exist for the specified .
public DisconnectOne ( System.Guid clientID ) : void
clientID System.Guid ID of the client to be disconnected.
리턴 void

Dispose() 보호된 메소드

Releases the unmanaged resources used by the ZeroMQServer object 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 ZeroMQServer settings from the config file if the ServerBase.PersistSettings property is set to true.
public LoadSettings ( ) : void
리턴 void

OnClientConnectingException() 보호된 메소드

Raises the ServerBase.ClientConnectingException event.
protected OnClientConnectingException ( Exception ex ) : void
ex System.Exception The encountered when connecting to the client.
리턴 void

OnReceiveClientDataException() 보호된 메소드

Raises the ServerBase.ReceiveClientDataException event.
protected OnReceiveClientDataException ( System.Guid clientID, Exception ex ) : void
clientID System.Guid ID of client to send to event.
ex System.Exception Exception to send to event.
리턴 void

OnSendClientDataException() 보호된 메소드

Raises the ServerBase.SendClientDataException event.
protected OnSendClientDataException ( System.Guid clientID, Exception ex ) : void
clientID System.Guid ID of client to send to event.
ex System.Exception Exception to send to event.
리턴 void

OnUnhandledUserException() 보호된 메소드

Raises the ServerBase.UnhandledUserException event.
protected OnUnhandledUserException ( Exception ex ) : void
ex System.Exception Exception to send to event.
리턴 void

Read() 공개 메소드

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 ServerBase.ReceiveClientData event handler. Calling this method outside this event will have unexpected results.
/// No received data buffer has been defined to read -or- /// Specified does not exist, cannot read buffer. /// is null. /// or is less than 0 -or- /// and will exceed length. ///
public Read ( System.Guid clientID, byte buffer, int startIndex, int length ) : int
clientID System.Guid ID of the client from which data buffer should be read.
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 ZeroMQServer settings to the config file if the ServerBase.PersistSettings property is set to true.
public SaveSettings ( ) : void
리턴 void

SendDataToAsync() 보호된 메소드

Sends data to the specified client asynchronously.
protected SendDataToAsync ( System.Guid clientID, byte data, int offset, int length ) : WaitHandle
clientID System.Guid ID of the client to which the data is to be sent.
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

Start() 공개 메소드

Starts the ZeroMQServer synchronously and begins accepting client connections asynchronously.
Attempt is made to the when it is running.
public Start ( ) : void
리턴 void

Stop() 공개 메소드

Stops the ZeroMQServer synchronously and disconnects all connected clients.
public Stop ( ) : void
리턴 void

TryGetClient() 공개 메소드

Gets the TransportProvider{Socket} object associated with the specified client ID.
public TryGetClient ( System.Guid clientID, TransportProvider &clientInfo ) : bool
clientID System.Guid ID of the client.
clientInfo TransportProvider Client information.
리턴 bool

ValidateConfigurationString() 보호된 메소드

Validates the specified configurationString.
Port property is missing. Port property value is not between and .
protected ValidateConfigurationString ( string configurationString ) : void
configurationString string Configuration string to be validated.
리턴 void

ZeroMQServer() 공개 메소드

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

ZeroMQServer() 공개 메소드

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

ZeroMQServer() 공개 메소드

Initializes a new instance of the ZeroMQServer class.
public ZeroMQServer ( string configString ) : System
configString string Config string of the . See for format.
리턴 System