C# 클래스 GSF.PhasorProtocols.MultiProtocolFrameParser.SharedUdpClientReference

Shared UDP client reference.
This class is used to create multiple IClient instances which share a single UDP client.
One shared UDP client instance will be created per local end point.
상속: IClient
파일 보기 프로젝트 열기: GridProtectionAlliance/gsf

공개 메소드들

메소드 설명
Connect ( ) : void

Connects the client to the server synchronously.

ConnectAsync ( ) : WaitHandle

Connects the client to the server asynchronously.

Derived classes are expected to override this method with protocol specific connection operations. Call the base class method to obtain an operational wait handle if protocol connection operation doesn't provide one already.

Disconnect ( ) : void

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

Dispose ( ) : void

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

Initialize ( ) : void

Initializes the client.

Initialize() is to be called by user-code directly only if the client is not consumed through the designer surface of the IDE.

Read ( 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 ClientBase.ReceiveData event handler. Calling this method outside this event will have unexpected results.

Send ( byte data, int offset, int length ) : void

Sends data to the server synchronously.

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

Sends data to the server asynchronously.

비공개 메소드들

메소드 설명
GetLocalEndPoint ( ) : EndPoint

Determines the local end point this client intends to listen on via connection string properties.

GetSharedClient ( ) : void

Gets a reference to the shared client listening on this client's local end point.

OnConnectionEstablished ( ) : void
ReturnSharedClient ( ) : void

Releases a reference to this client's shared client, and disposes of the shared client if nobody is using it.

SharedClient_ConnectionAttempt ( object sender, EventArgs e ) : void
SharedClient_ConnectionEstablished ( object sender, EventArgs e ) : void
SharedClient_ConnectionException ( object sender, EventArgs e ) : void
SharedClient_ConnectionTerminated ( object sender, EventArgs e ) : void
SharedClient_ReceiveDataException ( object sender, EventArgs e ) : void
SharedClient_ReceiveDataFrom ( object sender, EventArgs e ) : void
SharedClient_SendDataException ( object sender, EventArgs e ) : void
SharedClient_UnhandledUserException ( object sender, EventArgs e ) : void
TerminateSharedClient ( ) : void

Terminates the client as quickly as possible and removes it from the collection of shared clients.

메소드 상세

Connect() 공개 메소드

Connects the client to the server synchronously.
public Connect ( ) : void
리턴 void

ConnectAsync() 공개 메소드

Connects the client to the server asynchronously.
Derived classes are expected to override this method with protocol specific connection operations. Call the base class method to obtain an operational wait handle if protocol connection operation doesn't provide one already.
Server property in is invalid. Attempt is made to connect the client 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 client and optionally releases the managed resources.
public Dispose ( ) : void
리턴 void

Initialize() 공개 메소드

Initializes the client.
Initialize() is to be called by user-code directly only if the client is not consumed through the designer surface of the IDE.
public Initialize ( ) : void
리턴 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 ClientBase.ReceiveData event handler. Calling this method outside this event will have unexpected results.
No received data buffer has been defined to read. is null. /// or is less than 0 -or- /// and will exceed length. ///
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

Send() 공개 메소드

Sends data to the server synchronously.
public Send ( byte data, int offset, int length ) : void
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 .
리턴 void

SendAsync() 공개 메소드

Sends data to the server asynchronously.
public SendAsync ( 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