readAll function

SocketMessage readAll(
  1. int socket, [
  2. int bufferSize = 1024
])

Reads all available data from the specified socket.

This function reads data from the specified socket until no more data is available. It returns a SocketMessage object containing the total number of bytes read and the concatenated data.

Parameters:

  • socket: The integer file descriptor of the socket to read from.
  • bufferSize: The maximum number of bytes to read at once (default is 1024).

Returns: A SocketMessage object containing the total number of bytes read and the concatenated data.

Throws:

  • Exception: If an error occurs while reading from the socket.

Implementation

SocketMessage readAll(int socket, [int bufferSize = 1024]) =>
    _implementation.readAll(socket, bufferSize);