C# 클래스 CrossroadsIO.SendReceiveExtensions

Defines extensions for Send/Receive methods in Socket.
파일 보기 프로젝트 열기: jgoz/crossroads-net

공개 메소드들

메소드 설명
Receive ( this socket, Encoding encoding ) : string

Receive a string message from a remote socket in blocking mode.

Receive ( this socket, Encoding encoding, System.TimeSpan timeout ) : string

Receive a string message from a remote socket in non-blocking mode with a specified timeout.

ReceiveFrame ( this socket ) : Frame

Receive a single frame from a remote socket in blocking mode.

This overload will allocate a new Frame for receiving all available data in the message-part.

ReceiveFrame ( this socket, Frame frame ) : Frame

Receive a single frame from a remote socket in blocking mode.

This overload will receive all available data in the message-part. If the buffer size of frame is insufficient, a new buffer will be allocated.

ReceiveFrame ( this socket, Frame frame, System.TimeSpan timeout ) : Frame

Receive a single frame from a remote socket in non-blocking mode with a specified timeout.

This overload will receive all available data in the message-part. If the buffer size of frame is insufficient, a new buffer will be allocated.

ReceiveFrame ( this socket, System.TimeSpan timeout ) : Frame

Receive a single frame from a remote socket in non-blocking mode with a specified timeout.

This overload will allocate a new Frame for receiving all available data in the message-part.

ReceiveMessage ( this socket ) : Message

Receive all parts of a multi-part message from a remote socket in blocking mode.

ReceiveMessage ( this socket, Message message ) : Message

Receive all parts of a multi-part message from a remote socket in blocking mode and append them to a given message.

ReceiveMessage ( this socket, Message message, System.TimeSpan frameTimeout ) : Message

Receive all parts of a multi-part message from a remote socket in non-blocking mode.

The frameTimeout will be used for each underlying Receive operation. If the timeout elapses before the last message is received, an incomplete message will be returned.

ReceiveMessage ( this socket, System.TimeSpan frameTimeout ) : Message

Receive all parts of a multi-part message from a remote socket in non-blocking mode.

The frameTimeout will be used for each underlying Receive operation. If the timeout elapses before the last message is received, an incomplete message will be returned. Use the ReceiveMessage(Socket,Message,System.TimeSpan) overload to continue appending message-parts if the returned Message has its Message.IsComplete property set to false.

Send ( this socket, byte buffer ) : SendStatus

Queue a single-part (or final multi-part) message buffer to be sent by the socket in blocking mode.

This method assumes that the message fills the entire buffer.

Send ( this socket, byte buffer, System.TimeSpan timeout ) : SendStatus

Queue a single-part (or final multi-part) message buffer to be sent by the socket in non-blocking mode with a specified timeout.

This method assumes that the message fills the entire buffer.

Send ( this socket, string message, Encoding encoding ) : SendStatus

Queue a single-part (or final multi-part) message string to be sent by the socket in blocking mode.

Send ( this socket, string message, Encoding encoding, System.TimeSpan timeout ) : SendStatus

Queue a single-part (or final multi-part) message string to be sent by the socket in non-blocking mode with a specified timeout.

SendFrame ( this socket, Frame frame ) : SendStatus

Queue a message frame to be sent by the socket in blocking mode.

The Frame.HasMore property on frame will be used to indicate whether more frames will follow in the current multi-part message sequence.

SendFrame ( this socket, Frame frame, System.TimeSpan timeout ) : SendStatus

Queue a message frame to be sent by the socket in non-blocking mode with a specified timeout.

The Frame.HasMore property on frame will be used to indicate whether more frames will follow in the current multi-part message sequence.

SendMessage ( this socket, Message message ) : SendStatus

Queue a multi-part message to be sent by the socket in blocking mode.

SendMore ( this socket, byte buffer ) : SendStatus

Queue a non-final message-part buffer to be sent by the socket in blocking mode.

This method assumes that the message fills the entire buffer. The final message-part in this series must be sent with Send(Socket,byte[]) or another overload that does not specify SocketFlags.SendMore.

SendMore ( this socket, byte buffer, System.TimeSpan timeout ) : SendStatus

Queue a non-final message-part buffer to be sent by the socket in non-blocking mode with a specified timeout.

This method assumes that the message fills the entire buffer. The final message-part in this series must be sent with Send(Socket,byte[],TimeSpan) or another overload that does not specify SocketFlags.SendMore.

SendMore ( this socket, string message, Encoding encoding ) : SendStatus

Queue a non-final message-part string to be sent by the socket in blocking mode.

SendMore ( this socket, string message, Encoding encoding, System.TimeSpan timeout ) : SendStatus

Queue a non-final message-part string to be sent by the socket in non-blocking mode with a specified timeout.

비공개 메소드들

메소드 설명
SetFrameProperties ( Frame frame, Socket socket, int size ) : void
VerifyEncoding ( Encoding encoding ) : void
VerifyFrame ( Frame frame ) : void
VerifyMessage ( Message message ) : void
VerifySocket ( Socket socket ) : void
VerifyStringMessage ( string message ) : void

메소드 상세

Receive() 공개 정적인 메소드

Receive a string message from a remote socket in blocking mode.
is null. An error occurred receiving data from a remote endpoint. The has been closed. The current socket type does not support Receive operations.
public static Receive ( this socket, Encoding encoding ) : string
socket this A object.
encoding System.Text.Encoding The to use when converting the received buffer to a string.
리턴 string

Receive() 공개 정적인 메소드

Receive a string message from a remote socket in non-blocking mode with a specified timeout.
is null. An error occurred receiving data from a remote endpoint. The has been closed. The current socket type does not support Receive operations.
public static Receive ( this socket, Encoding encoding, System.TimeSpan timeout ) : string
socket this A object.
encoding System.Text.Encoding The to use when converting the received buffer to a string.
timeout System.TimeSpan A specifying the receive timeout.
리턴 string

ReceiveFrame() 공개 정적인 메소드

Receive a single frame from a remote socket in blocking mode.
This overload will allocate a new Frame for receiving all available data in the message-part.
An error occurred receiving data from a remote endpoint. The has been closed. The current socket type does not support Receive operations.
public static ReceiveFrame ( this socket ) : Frame
socket this A object.
리턴 Frame

ReceiveFrame() 공개 정적인 메소드

Receive a single frame from a remote socket in blocking mode.
This overload will receive all available data in the message-part. If the buffer size of frame is insufficient, a new buffer will be allocated.
An error occurred receiving data from a remote endpoint. The has been closed. The current socket type does not support Receive operations.
public static ReceiveFrame ( this socket, Frame frame ) : Frame
socket this A object.
frame Frame A that will store the received data.
리턴 Frame

ReceiveFrame() 공개 정적인 메소드

Receive a single frame from a remote socket in non-blocking mode with a specified timeout.
This overload will receive all available data in the message-part. If the buffer size of frame is insufficient, a new buffer will be allocated.
An error occurred receiving data from a remote endpoint. The has been closed. The current socket type does not support Receive operations.
public static ReceiveFrame ( this socket, Frame frame, System.TimeSpan timeout ) : Frame
socket this A object.
frame Frame A that will store the received data.
timeout System.TimeSpan A specifying the receive timeout.
리턴 Frame

ReceiveFrame() 공개 정적인 메소드

Receive a single frame from a remote socket in non-blocking mode with a specified timeout.
This overload will allocate a new Frame for receiving all available data in the message-part.
An error occurred receiving data from a remote endpoint. The has been closed. The current socket type does not support Receive operations.
public static ReceiveFrame ( this socket, System.TimeSpan timeout ) : Frame
socket this A object.
timeout System.TimeSpan A specifying the receive timeout.
리턴 Frame

ReceiveMessage() 공개 정적인 메소드

Receive all parts of a multi-part message from a remote socket in blocking mode.
An error occurred receiving data from a remote endpoint. The has been closed. The current socket type does not support Receive operations.
public static ReceiveMessage ( this socket ) : Message
socket this A object.
리턴 Message

ReceiveMessage() 공개 정적인 메소드

Receive all parts of a multi-part message from a remote socket in blocking mode and append them to a given message.
is null. An error occurred receiving data from a remote endpoint. The has been closed. The current socket type does not support Receive operations.
public static ReceiveMessage ( this socket, Message message ) : Message
socket this A object.
message Message The to which message-parts will be appended.
리턴 Message

ReceiveMessage() 공개 정적인 메소드

Receive all parts of a multi-part message from a remote socket in non-blocking mode.
The frameTimeout will be used for each underlying Receive operation. If the timeout elapses before the last message is received, an incomplete message will be returned.
An error occurred receiving data from a remote endpoint. The has been closed. The current socket type does not support Receive operations.
public static ReceiveMessage ( this socket, Message message, System.TimeSpan frameTimeout ) : Message
socket this A object.
message Message The to which message-parts will be appended.
frameTimeout System.TimeSpan A specifying the receive timeout for each frame.
리턴 Message

ReceiveMessage() 공개 정적인 메소드

Receive all parts of a multi-part message from a remote socket in non-blocking mode.
The frameTimeout will be used for each underlying Receive operation. If the timeout elapses before the last message is received, an incomplete message will be returned. Use the ReceiveMessage(Socket,Message,System.TimeSpan) overload to continue appending message-parts if the returned Message has its Message.IsComplete property set to false.
An error occurred receiving data from a remote endpoint. The has been closed. The current socket type does not support Receive operations.
public static ReceiveMessage ( this socket, System.TimeSpan frameTimeout ) : Message
socket this A object.
frameTimeout System.TimeSpan A specifying the receive timeout for each frame.
리턴 Message

Send() 공개 정적인 메소드

Queue a single-part (or final multi-part) message buffer to be sent by the socket in blocking mode.
This method assumes that the message fills the entire buffer.
is null. An error occurred sending data to a remote endpoint. The has been closed. The current socket type does not support Send operations.
public static Send ( this socket, byte buffer ) : SendStatus
socket this A object.
buffer byte A array that contains the message to be sent.
리턴 SendStatus

Send() 공개 정적인 메소드

Queue a single-part (or final multi-part) message buffer to be sent by the socket in non-blocking mode with a specified timeout.
This method assumes that the message fills the entire buffer.
is null. An error occurred sending data to a remote endpoint. The has been closed. The current socket type does not support Send operations.
public static Send ( this socket, byte buffer, System.TimeSpan timeout ) : SendStatus
socket this A object.
buffer byte A array that contains the message to be sent.
timeout System.TimeSpan A specifying the send timeout.
리턴 SendStatus

Send() 공개 정적인 메소드

Queue a single-part (or final multi-part) message string to be sent by the socket in blocking mode.
or is null. An error occurred sending data to a remote endpoint. The has been closed. The current socket type does not support Send operations.
public static Send ( this socket, string message, Encoding encoding ) : SendStatus
socket this A object.
message string A that contains the message to be sent.
encoding System.Text.Encoding The to use when converting to a buffer.
리턴 SendStatus

Send() 공개 정적인 메소드

Queue a single-part (or final multi-part) message string to be sent by the socket in non-blocking mode with a specified timeout.
or is null. An error occurred sending data to a remote endpoint. The has been closed. The current socket type does not support Send operations.
public static Send ( this socket, string message, Encoding encoding, System.TimeSpan timeout ) : SendStatus
socket this A object.
message string A that contains the message to be sent.
encoding System.Text.Encoding The to use when converting to a buffer.
timeout System.TimeSpan A specifying the send timeout.
리턴 SendStatus

SendFrame() 공개 정적인 메소드

Queue a message frame to be sent by the socket in blocking mode.
The Frame.HasMore property on frame will be used to indicate whether more frames will follow in the current multi-part message sequence.
is null. An error occurred sending data to a remote endpoint. The has been closed. The current socket type does not support Send operations.
public static SendFrame ( this socket, Frame frame ) : SendStatus
socket this A object.
frame Frame A that contains the message to be sent.
리턴 SendStatus

SendFrame() 공개 정적인 메소드

Queue a message frame to be sent by the socket in non-blocking mode with a specified timeout.
The Frame.HasMore property on frame will be used to indicate whether more frames will follow in the current multi-part message sequence.
is null. An error occurred sending data to a remote endpoint. The has been closed. The current socket type does not support Send operations.
public static SendFrame ( this socket, Frame frame, System.TimeSpan timeout ) : SendStatus
socket this A object.
frame Frame A that contains the message to be sent.
timeout System.TimeSpan A specifying the send timeout.
리턴 SendStatus

SendMessage() 공개 정적인 메소드

Queue a multi-part message to be sent by the socket in blocking mode.
is null. is incomplete. An error occurred sending data to a remote endpoint. The has been closed. The current socket type does not support Send operations.
public static SendMessage ( this socket, Message message ) : SendStatus
socket this A object.
message Message A that contains the message parts to be sent.
리턴 SendStatus

SendMore() 공개 정적인 메소드

Queue a non-final message-part buffer to be sent by the socket in blocking mode.
This method assumes that the message fills the entire buffer. The final message-part in this series must be sent with Send(Socket,byte[]) or another overload that does not specify SocketFlags.SendMore.
is null. An error occurred sending data to a remote endpoint. The has been closed. The current socket type does not support Send operations.
public static SendMore ( this socket, byte buffer ) : SendStatus
socket this A object.
buffer byte A array that contains the message to be sent.
리턴 SendStatus

SendMore() 공개 정적인 메소드

Queue a non-final message-part buffer to be sent by the socket in non-blocking mode with a specified timeout.
This method assumes that the message fills the entire buffer. The final message-part in this series must be sent with Send(Socket,byte[],TimeSpan) or another overload that does not specify SocketFlags.SendMore.
is null. An error occurred sending data to a remote endpoint. The has been closed. The current socket type does not support Send operations.
public static SendMore ( this socket, byte buffer, System.TimeSpan timeout ) : SendStatus
socket this A object.
buffer byte A array that contains the message to be sent.
timeout System.TimeSpan A specifying the send timeout.
리턴 SendStatus

SendMore() 공개 정적인 메소드

Queue a non-final message-part string to be sent by the socket in blocking mode.
or is null. An error occurred sending data to a remote endpoint. The has been closed. The current socket type does not support Send operations.
public static SendMore ( this socket, string message, Encoding encoding ) : SendStatus
socket this A object.
message string A that contains the message to be sent.
encoding System.Text.Encoding The to use when converting to a buffer.
리턴 SendStatus

SendMore() 공개 정적인 메소드

Queue a non-final message-part string to be sent by the socket in non-blocking mode with a specified timeout.
or is null. An error occurred sending data to a remote endpoint. The has been closed. The current socket type does not support Send operations.
public static SendMore ( this socket, string message, Encoding encoding, System.TimeSpan timeout ) : SendStatus
socket this A object.
message string A that contains the message to be sent.
encoding System.Text.Encoding The to use when converting to a buffer.
timeout System.TimeSpan A specifying the send timeout.
리턴 SendStatus