Google is committed to advancing racial equity for Black communities. See how.

SocketPair constructor

*<Null safety>*

SocketPair([int options = Socket.STREAM])

Implementation

factory SocketPair([int options = Socket.STREAM]) {
  final HandlePairResult result = System.socketCreate(options);
  if (result.status == ZX.OK) {
    return SocketPair._(
        result.status, Socket(result.first), Socket(result.second));
  } else {
    return SocketPair._(result.status, null, null);
  }
}