C# Class OpenStory.Networking.SendDescriptor

Inheritance: DescriptorBase
Exibir arquivo Open project: shoftee/OpenStory Class Usage Examples

Public Methods

Method Description
SendDescriptor ( IDescriptorContainer container ) : System

Initializes a new instance of the SendDescriptor class.

Write ( byte data ) : void

Writes a byte array to the stream.

Protected Methods

Method Description
OnClosed ( ) : void

Private Methods

Method Description
BeginSend ( ) : void
EndSendAsynchronous ( object sender, SocketAsyncEventArgs args ) : void

Asynchronous EndSend, also the callback for the Completed event.

If there is more data to send, this method will call BeginSend().

EndSendSynchronous ( SocketAsyncEventArgs args ) : bool

Synchronous EndSend.

This method will return true if there is more data to send. If there is no more data or if there was a connection error, it will return false.

HandleTransferredData ( SocketAsyncEventArgs args ) : bool

Handles the data which was transferred using the given SocketAsyncEventArgs object.

This method advances the sentBytes field forward and moves to the next segment in the queue if the current has finished sending.

If there was a connection error, this method will return . If all the queued data has been sent, this method will set isSending to and return . Otherwise it will return .

ResetBuffer ( ) : void

Looks at the current segment and adjusts the SocketArgs buffer to it.

Method Details

OnClosed() protected method

protected OnClosed ( ) : void
return void

SendDescriptor() public method

Initializes a new instance of the SendDescriptor class.
/// Thrown if is . ///
public SendDescriptor ( IDescriptorContainer container ) : System
container IDescriptorContainer The containing this instance.
return System

Write() public method

Writes a byte array to the stream.
/// Thrown if this session is not open. /// /// Thrown if is . ///
public Write ( byte data ) : void
data byte The data to write.
return void