reads the next available message on the specified socket, returning it as a byte array.
- The socket is specified as a SocketObject[…].
- For ZMQ sockets, SocketReadMessage returns the next discrete message sent to the socket. It returns all multi-part elements joined together into a single ByteArray.
- For TCP sockets, SocketReadMessage will return a ByteArray of the data currently in the operating system buffer.
Examplesopen allclose all
Basic Examples (2)
Writing a message from one side will send the message to the other side as a ByteArray:
Turn it into a string with ByteArrayToString:
For TCP sockets, the size of the message returned by SocketReadMessage is not deterministic and is controlled by the OS: