read method

SocketUserReading read(
  1. Socket socket
)

The user on the other end of socket, or Unread with why the kernel did not name one.

Implementation

SocketUserReading read(Socket socket) {
  try {
    return switch (_kernel) {
      Kernel.linux => _linux(socket),
      Kernel.macos => _macos(socket),
      Kernel.other => const Unread(UnsupportedKernel()),
    };
  } on SocketException catch (exception) {
    return Unread(ReadFailed(exception));
  }
}