C# Класс NetMQ.ReceivingSocketExtensions

This static class serves to provide extension methods for IReceivingSocket.
Показать файл Открыть проект

Открытые методы

Метод Описание
Receive ( this socket, Msg &msg ) : void

Block until the next message arrives, then make the message's data available via msg.

The call blocks until the next message arrives, and cannot be interrupted. This a convenient and safe when you know a message is available, such as for code within a NetMQSocket.ReceiveReady callback.

ReceiveMultipartBytes ( [ socket, List &frames, int expectedFrameCount = 4 ) : void

Receive all frames of the next message from socket, blocking until a message arrives.

ReceiveSignal ( [ socket ) : bool

Receive frames from socket, blocking until a valid signal arrives.

SkipFrame ( [ socket ) : void

Receive a single frame from socket, blocking until one arrives, then ignore its content.

SkipFrame ( [ socket, bool &more ) : void

Receive a single frame from socket, blocking until one arrives, then ignore its content. Indicate whether further frames exist via more.

SkipMultipartMessage ( [ socket ) : void

Receive all frames of the next message from socket, blocking until a message arrives, then ignore their contents.

TryReceiveFrameBytes ( [ socket, System.TimeSpan timeout, byte &bytes ) : bool

Attempt to receive a single frame from socket. If no message is available within timeout, return false.

TryReceiveFrameBytes ( [ socket, System.TimeSpan timeout, byte &bytes, bool &more ) : bool

Attempt to receive a single frame from socket. If no message is available within timeout, return false. Indicate whether further frames exist via more.

TryReceiveFrameBytes ( [ socket, byte &bytes ) : bool

Attempt to receive a single frame from socket. If no message is immediately available, return false.

TryReceiveFrameBytes ( [ socket, byte &bytes, bool &more ) : bool

Attempt to receive a single frame from socket. If no message is immediately available, return false. Indicate whether further frames exist via more.

TryReceiveFrameString ( [ socket, System.TimeSpan timeout, [ encoding, string &frameString ) : bool

Attempt to receive a single frame from socket, and decode as a string using encoding. If no message is available within timeout, return false.

TryReceiveFrameString ( [ socket, System.TimeSpan timeout, [ encoding, string &frameString, bool &more ) : bool

Attempt to receive a single frame from socket, and decode as a string using encoding. If no message is available within timeout, return false.

TryReceiveFrameString ( [ socket, System.TimeSpan timeout, string &frameString ) : bool

Attempt to receive a single frame from socket, and decode as a string using DefaultEncoding. If no message is available within timeout, return false.

TryReceiveFrameString ( [ socket, System.TimeSpan timeout, string &frameString, bool &more ) : bool

Attempt to receive a single frame from socket, and decode as a string using DefaultEncoding. If no message is available within timeout, return false.

TryReceiveFrameString ( [ socket, [ encoding, string &frameString ) : bool

Attempt to receive a single frame from socket, and decode as a string using encoding. If no message is immediately available, return false.

TryReceiveFrameString ( [ socket, [ encoding, string &frameString, bool &more ) : bool

Attempt to receive a single frame from socket, and decode as a string using encoding. If no message is immediately available, return false.

TryReceiveFrameString ( [ socket, string &frameString ) : bool

Attempt to receive a single frame from socket, and decode as a string using DefaultEncoding. If no message is immediately available, return false.

TryReceiveFrameString ( [ socket, string &frameString, bool &more ) : bool

Attempt to receive a single frame from socket, and decode as a string using DefaultEncoding. If no message is immediately available, return false.

TryReceiveMultipartBytes ( [ socket, List &frames, int expectedFrameCount = 4 ) : bool

Attempt to receive all frames of the next message from socket. If no message is immediately available, return false.

TryReceiveMultipartBytes ( [ socket, System.TimeSpan timeout, List &frames, int expectedFrameCount = 4 ) : bool

Attempt to receive all frames of the next message from socket. If no message is available within timeout, return false.

TryReceiveMultipartMessage ( [ socket, System.TimeSpan timeout, [ message, int expectedFrameCount = 4 ) : bool

Attempt to receive all frames of the next message from socket. If no message is available within timeout, return false.

TryReceiveMultipartMessage ( [ socket, [ message, int expectedFrameCount = 4 ) : bool

Attempt to receive all frames of the next message from socket. If no message is immediately available, return false.

TryReceiveMultipartStrings ( [ socket, System.TimeSpan timeout, [ encoding, [ frames, int expectedFrameCount = 4 ) : bool

Attempt to receive all frames of the next message from socket, and decode them as strings using encoding. If no message is available within timeout, return false.

TryReceiveMultipartStrings ( [ socket, System.TimeSpan timeout, [ frames, int expectedFrameCount = 4 ) : bool

Attempt to receive all frames of the next message from socket, and decode them as strings using DefaultEncoding. If no message is available within timeout, return false.

TryReceiveMultipartStrings ( [ socket, [ encoding, [ frames, int expectedFrameCount = 4 ) : bool

Attempt to receive all frames of the next message from socket, and decode them as strings using encoding. If no message is immediately available, return false.

TryReceiveMultipartStrings ( [ socket, [ frames, int expectedFrameCount = 4 ) : bool

Attempt to receive all frames of the next message from socket, and decode them as strings using DefaultEncoding. If no message is immediately available, return false.

TryReceiveSignal ( [ socket, System.TimeSpan timeout, bool &signal ) : bool

Attempt to receive a valid signal from socket. If no message is available within timeout, return false.

TryReceiveSignal ( [ socket, bool &signal ) : bool

Attempt to receive a valid signal from socket. If no message is immediately available, return false.

TrySkipFrame ( [ socket ) : bool

Attempt to receive a single frame from socket, then ignore its content. If no message is immediately available, return false.

TrySkipFrame ( [ socket, System.TimeSpan timeout ) : bool

Attempt to receive a single frame from socket, then ignore its content. If no message is available within timeout, return false.

TrySkipFrame ( [ socket, System.TimeSpan timeout, bool &more ) : bool

Attempt to receive a single frame from socket, then ignore its content. If no message is available within timeout, return false. Indicate whether further frames exist via more.

TrySkipFrame ( [ socket, bool &more ) : bool

Attempt to receive a single frame from socket, then ignore its content. If no message is immediately available, return false. Indicate whether further frames exist via more.

TrySkipMultipartMessage ( [ socket ) : bool

Attempt to receive all frames of the next message from socket, then ignore their contents. If no message is immediately available, return false.

TrySkipMultipartMessage ( [ socket, System.TimeSpan timeout ) : bool

Attempt to receive all frames of the next message from socket, then ignore their contents. If no message is available within timeout, return false.

Приватные методы

Метод Описание
Receive ( [ socket ) : byte[]
Receive ( [ socket, SendReceiveOptions options ) : byte[]
Receive ( [ socket, SendReceiveOptions options, bool &hasMore ) : byte[]
Receive ( [ socket, System.TimeSpan timeout ) : byte[]
Receive ( [ socket, bool &hasMore ) : byte[]
Receive ( [ socket, bool dontWait, bool &hasMore ) : byte[]
ReceiveAll ( [ socket, int expectedFrameCount = 4 ) : List
ReceiveAllString ( [ socket ) : IList
ReceiveFrameBytes ( [ socket ) : byte[]
ReceiveFrameBytes ( [ socket, bool &more ) : byte[]
ReceiveFrameString ( [ socket ) : string
ReceiveFrameString ( [ socket, [ encoding ) : string
ReceiveFrameString ( [ socket, [ encoding, bool &more ) : string
ReceiveFrameString ( [ socket, bool &more ) : string
ReceiveMessage ( [ socket, System.TimeSpan timeout ) : NetMQMessage
ReceiveMessage ( [ socket, bool dontWait = false ) : NetMQMessage
ReceiveMessage ( [ socket, [ message, bool dontWait = false ) : void
ReceiveMessages ( [ socket, int expectedFrameCount = 4 ) : List
ReceiveMultipartBytes ( [ socket, int expectedFrameCount = 4 ) : List
ReceiveMultipartMessage ( [ socket, int expectedFrameCount = 4 ) : NetMQMessage
ReceiveMultipartStrings ( [ socket, [ encoding, int expectedFrameCount = 4 ) : List
ReceiveMultipartStrings ( [ socket, int expectedFrameCount = 4 ) : List
ReceiveString ( [ socket ) : string
ReceiveString ( [ socket, SendReceiveOptions options ) : string
ReceiveString ( [ socket, SendReceiveOptions options, bool &hasMore ) : string
ReceiveString ( [ socket, System.TimeSpan timeout ) : string
ReceiveString ( [ socket, [ encoding ) : string
ReceiveString ( [ socket, [ encoding, SendReceiveOptions options ) : string
ReceiveString ( [ socket, [ encoding, SendReceiveOptions options, bool &hasMore ) : string
ReceiveString ( [ socket, [ encoding, System.TimeSpan timeout ) : string
ReceiveString ( [ socket, [ encoding, bool &hasMore ) : string
ReceiveString ( [ socket, [ encoding, bool dontWait, bool &hasMore ) : string
ReceiveString ( [ socket, bool &hasMore ) : string
ReceiveString ( [ socket, bool dontWait, bool &hasMore ) : string
ReceiveStringMessages ( [ socket, [ encoding, int expectedFrameCount = 4 ) : List
ReceiveStringMessages ( [ socket, int expectedFrameCount = 4 ) : List
WaitForSignal ( [ socket ) : bool

Описание методов

Receive() публичный статический Метод

Block until the next message arrives, then make the message's data available via msg.
The call blocks until the next message arrives, and cannot be interrupted. This a convenient and safe when you know a message is available, such as for code within a NetMQSocket.ReceiveReady callback.
public static Receive ( this socket, Msg &msg ) : void
socket this The socket to receive from.
msg Msg An object to receive the message's data into.
Результат void

ReceiveMultipartBytes() публичный статический Метод

Receive all frames of the next message from socket, blocking until a message arrives.
public static ReceiveMultipartBytes ( [ socket, List &frames, int expectedFrameCount = 4 ) : void
socket [ The socket to receive from.
frames List Reference to a list for return values. If null a new instance will be assigned, otherwise the provided list will be cleared and populated.
expectedFrameCount int Optional initial for the returned .
Результат void

ReceiveSignal() публичный статический Метод

Receive frames from socket, blocking until a valid signal arrives.
public static ReceiveSignal ( [ socket ) : bool
socket [ The socket to receive from.
Результат bool

SkipFrame() публичный статический Метод

Receive a single frame from socket, blocking until one arrives, then ignore its content.
public static SkipFrame ( [ socket ) : void
socket [ The socket to receive from.
Результат void

SkipFrame() публичный статический Метод

Receive a single frame from socket, blocking until one arrives, then ignore its content. Indicate whether further frames exist via more.
public static SkipFrame ( [ socket, bool &more ) : void
socket [ The socket to receive from.
more bool true if another frame of the same message follows, otherwise false.
Результат void

SkipMultipartMessage() публичный статический Метод

Receive all frames of the next message from socket, blocking until a message arrives, then ignore their contents.
public static SkipMultipartMessage ( [ socket ) : void
socket [ The socket to receive from.
Результат void

TryReceiveFrameBytes() публичный статический Метод

Attempt to receive a single frame from socket. If no message is available within timeout, return false.
public static TryReceiveFrameBytes ( [ socket, System.TimeSpan timeout, byte &bytes ) : bool
socket [ The socket to receive from.
timeout System.TimeSpan The maximum period of time to wait for a message to become available.
bytes byte The content of the received message frame, or null if no message was available.
Результат bool

TryReceiveFrameBytes() публичный статический Метод

Attempt to receive a single frame from socket. If no message is available within timeout, return false. Indicate whether further frames exist via more.
public static TryReceiveFrameBytes ( [ socket, System.TimeSpan timeout, byte &bytes, bool &more ) : bool
socket [ The socket to receive from.
timeout System.TimeSpan The maximum period of time to wait for a message to become available.
bytes byte The content of the received message frame, or null if no message was available.
more bool true if another frame of the same message follows, otherwise false.
Результат bool

TryReceiveFrameBytes() публичный статический Метод

Attempt to receive a single frame from socket. If no message is immediately available, return false.
public static TryReceiveFrameBytes ( [ socket, byte &bytes ) : bool
socket [ The socket to receive from.
bytes byte The content of the received message frame, or null if no message was available.
Результат bool

TryReceiveFrameBytes() публичный статический Метод

Attempt to receive a single frame from socket. If no message is immediately available, return false. Indicate whether further frames exist via more.
public static TryReceiveFrameBytes ( [ socket, byte &bytes, bool &more ) : bool
socket [ The socket to receive from.
bytes byte The content of the received message frame, or null if no message was available.
more bool true if another frame of the same message follows, otherwise false.
Результат bool

TryReceiveFrameString() публичный статический Метод

Attempt to receive a single frame from socket, and decode as a string using encoding. If no message is available within timeout, return false.
public static TryReceiveFrameString ( [ socket, System.TimeSpan timeout, [ encoding, string &frameString ) : bool
socket [ The socket to receive from.
timeout System.TimeSpan The maximum period of time to wait for a message to become available.
encoding [ The encoding used to convert the frame's data to a string.
frameString string The content of the received message frame as a string, or null if no message was available.
Результат bool

TryReceiveFrameString() публичный статический Метод

Attempt to receive a single frame from socket, and decode as a string using encoding. If no message is available within timeout, return false.
public static TryReceiveFrameString ( [ socket, System.TimeSpan timeout, [ encoding, string &frameString, bool &more ) : bool
socket [ The socket to receive from.
timeout System.TimeSpan The maximum period of time to wait for a message to become available.
encoding [ The encoding used to convert the frame's data to a string.
frameString string The content of the received message frame as a string, or null if no message was available.
more bool true if another frame of the same message follows, otherwise false.
Результат bool

TryReceiveFrameString() публичный статический Метод

Attempt to receive a single frame from socket, and decode as a string using DefaultEncoding. If no message is available within timeout, return false.
public static TryReceiveFrameString ( [ socket, System.TimeSpan timeout, string &frameString ) : bool
socket [ The socket to receive from.
timeout System.TimeSpan The maximum period of time to wait for a message to become available.
frameString string The content of the received message frame as a string, or null if no message was available.
Результат bool

TryReceiveFrameString() публичный статический Метод

Attempt to receive a single frame from socket, and decode as a string using DefaultEncoding. If no message is available within timeout, return false.
public static TryReceiveFrameString ( [ socket, System.TimeSpan timeout, string &frameString, bool &more ) : bool
socket [ The socket to receive from.
timeout System.TimeSpan The maximum period of time to wait for a message to become available.
frameString string The content of the received message frame as a string, or null if no message was available.
more bool true if another frame of the same message follows, otherwise false.
Результат bool

TryReceiveFrameString() публичный статический Метод

Attempt to receive a single frame from socket, and decode as a string using encoding. If no message is immediately available, return false.
public static TryReceiveFrameString ( [ socket, [ encoding, string &frameString ) : bool
socket [ The socket to receive from.
encoding [ The encoding used to convert the frame's data to a string.
frameString string The content of the received message frame as a string, or null if no message was available.
Результат bool

TryReceiveFrameString() публичный статический Метод

Attempt to receive a single frame from socket, and decode as a string using encoding. If no message is immediately available, return false.
public static TryReceiveFrameString ( [ socket, [ encoding, string &frameString, bool &more ) : bool
socket [ The socket to receive from.
encoding [ The encoding used to convert the frame's data to a string.
frameString string The content of the received message frame as a string, or null if no message was available.
more bool true if another frame of the same message follows, otherwise false.
Результат bool

TryReceiveFrameString() публичный статический Метод

Attempt to receive a single frame from socket, and decode as a string using DefaultEncoding. If no message is immediately available, return false.
public static TryReceiveFrameString ( [ socket, string &frameString ) : bool
socket [ The socket to receive from.
frameString string The content of the received message frame as a string, or null if no message was available.
Результат bool

TryReceiveFrameString() публичный статический Метод

Attempt to receive a single frame from socket, and decode as a string using DefaultEncoding. If no message is immediately available, return false.
public static TryReceiveFrameString ( [ socket, string &frameString, bool &more ) : bool
socket [ The socket to receive from.
frameString string The content of the received message frame as a string, or null if no message was available.
more bool true if another frame of the same message follows, otherwise false.
Результат bool

TryReceiveMultipartBytes() публичный статический Метод

Attempt to receive all frames of the next message from socket. If no message is immediately available, return false.
public static TryReceiveMultipartBytes ( [ socket, List &frames, int expectedFrameCount = 4 ) : bool
socket [ The socket to receive from.
frames List Reference to a list for return values. If null a new instance will be assigned, otherwise the provided list will be cleared and populated.
expectedFrameCount int Optional initial for the returned .
Результат bool

TryReceiveMultipartBytes() публичный статический Метод

Attempt to receive all frames of the next message from socket. If no message is available within timeout, return false.
public static TryReceiveMultipartBytes ( [ socket, System.TimeSpan timeout, List &frames, int expectedFrameCount = 4 ) : bool
socket [ The socket to receive from.
timeout System.TimeSpan The maximum period of time to wait for a message to become available.
frames List Reference to a list for return values. If null a new instance will be assigned, otherwise the provided list will be cleared and populated.
expectedFrameCount int Optional initial for the returned .
Результат bool

TryReceiveMultipartMessage() публичный статический Метод

Attempt to receive all frames of the next message from socket. If no message is available within timeout, return false.
public static TryReceiveMultipartMessage ( [ socket, System.TimeSpan timeout, [ message, int expectedFrameCount = 4 ) : bool
socket [ The socket to receive from.
timeout System.TimeSpan The maximum period of time to wait for a message to become available.
message [ The received message. Untouched if no message was available.
expectedFrameCount int Specifies the initial capacity of the used /// to buffer results. If the number of frames is known, set it here. If more frames arrive than expected, /// an extra allocation will occur, but the result will still be correct.
Результат bool

TryReceiveMultipartMessage() публичный статический Метод

Attempt to receive all frames of the next message from socket. If no message is immediately available, return false.
public static TryReceiveMultipartMessage ( [ socket, [ message, int expectedFrameCount = 4 ) : bool
socket [ The socket to receive from.
message [ The received message. Untouched if no message was available.
expectedFrameCount int Specifies the initial capacity of the used /// to buffer results. If the number of frames is known, set it here. If more frames arrive than expected, /// an extra allocation will occur, but the result will still be correct.
Результат bool

TryReceiveMultipartStrings() публичный статический Метод

Attempt to receive all frames of the next message from socket, and decode them as strings using encoding. If no message is available within timeout, return false.
public static TryReceiveMultipartStrings ( [ socket, System.TimeSpan timeout, [ encoding, [ frames, int expectedFrameCount = 4 ) : bool
socket [ The socket to receive from.
timeout System.TimeSpan The maximum period of time to wait for a message to become available.
encoding [ The encoding used to convert the frame's data to a string.
frames [ The frames of the received message as strings. Untouched if no message was available.
expectedFrameCount int Specifies the initial capacity of the used /// to buffer results. If the number of frames is known, set it here. If more frames arrive than expected, /// an extra allocation will occur, but the result will still be correct.
Результат bool

TryReceiveMultipartStrings() публичный статический Метод

Attempt to receive all frames of the next message from socket, and decode them as strings using DefaultEncoding. If no message is available within timeout, return false.
public static TryReceiveMultipartStrings ( [ socket, System.TimeSpan timeout, [ frames, int expectedFrameCount = 4 ) : bool
socket [ The socket to receive from.
timeout System.TimeSpan The maximum period of time to wait for a message to become available.
frames [ The frames of the received message as strings. Untouched if no message was available.
expectedFrameCount int Specifies the initial capacity of the used /// to buffer results. If the number of frames is known, set it here. If more frames arrive than expected, /// an extra allocation will occur, but the result will still be correct.
Результат bool

TryReceiveMultipartStrings() публичный статический Метод

Attempt to receive all frames of the next message from socket, and decode them as strings using encoding. If no message is immediately available, return false.
public static TryReceiveMultipartStrings ( [ socket, [ encoding, [ frames, int expectedFrameCount = 4 ) : bool
socket [ The socket to receive from.
encoding [ The encoding used to convert the frame's data to a string.
frames [ The frames of the received message as strings. Untouched if no message was available.
expectedFrameCount int Specifies the initial capacity of the used /// to buffer results. If the number of frames is known, set it here. If more frames arrive than expected, /// an extra allocation will occur, but the result will still be correct.
Результат bool

TryReceiveMultipartStrings() публичный статический Метод

Attempt to receive all frames of the next message from socket, and decode them as strings using DefaultEncoding. If no message is immediately available, return false.
public static TryReceiveMultipartStrings ( [ socket, [ frames, int expectedFrameCount = 4 ) : bool
socket [ The socket to receive from.
frames [ The frames of the received message as strings. Untouched if no message was available.
expectedFrameCount int Specifies the initial capacity of the used /// to buffer results. If the number of frames is known, set it here. If more frames arrive than expected, /// an extra allocation will occur, but the result will still be correct.
Результат bool

TryReceiveSignal() публичный статический Метод

Attempt to receive a valid signal from socket. If no message is available within timeout, return false.
public static TryReceiveSignal ( [ socket, System.TimeSpan timeout, bool &signal ) : bool
socket [ The socket to receive from.
timeout System.TimeSpan The maximum period of time to wait for a message to become available.
signal bool true if the received signal was zero, otherwise false. If no signal received, false.
Результат bool

TryReceiveSignal() публичный статический Метод

Attempt to receive a valid signal from socket. If no message is immediately available, return false.
public static TryReceiveSignal ( [ socket, bool &signal ) : bool
socket [ The socket to receive from.
signal bool true if the received signal was zero, otherwise false. If no signal received, false.
Результат bool

TrySkipFrame() публичный статический Метод

Attempt to receive a single frame from socket, then ignore its content. If no message is immediately available, return false.
public static TrySkipFrame ( [ socket ) : bool
socket [ The socket to receive from.
Результат bool

TrySkipFrame() публичный статический Метод

Attempt to receive a single frame from socket, then ignore its content. If no message is available within timeout, return false.
public static TrySkipFrame ( [ socket, System.TimeSpan timeout ) : bool
socket [ The socket to receive from.
timeout System.TimeSpan The maximum period of time to wait for a message to become available.
Результат bool

TrySkipFrame() публичный статический Метод

Attempt to receive a single frame from socket, then ignore its content. If no message is available within timeout, return false. Indicate whether further frames exist via more.
public static TrySkipFrame ( [ socket, System.TimeSpan timeout, bool &more ) : bool
socket [ The socket to receive from.
timeout System.TimeSpan The maximum period of time to wait for a message to become available.
more bool true if another frame of the same message follows, otherwise false.
Результат bool

TrySkipFrame() публичный статический Метод

Attempt to receive a single frame from socket, then ignore its content. If no message is immediately available, return false. Indicate whether further frames exist via more.
public static TrySkipFrame ( [ socket, bool &more ) : bool
socket [ The socket to receive from.
more bool true if another frame of the same message follows, otherwise false.
Результат bool

TrySkipMultipartMessage() публичный статический Метод

Attempt to receive all frames of the next message from socket, then ignore their contents. If no message is immediately available, return false.
public static TrySkipMultipartMessage ( [ socket ) : bool
socket [ The socket to receive from.
Результат bool

TrySkipMultipartMessage() публичный статический Метод

Attempt to receive all frames of the next message from socket, then ignore their contents. If no message is available within timeout, return false.
public static TrySkipMultipartMessage ( [ socket, System.TimeSpan timeout ) : bool
socket [ The socket to receive from.
timeout System.TimeSpan The maximum period of time to wait for a message to become available.
Результат bool