RawSocketOption.fromInt constructor

RawSocketOption.fromInt(int level int option int value)

Convenience constructor for creating an int based RawSocketOption.

Implementation

factory RawSocketOption.fromInt(int level, int option, int value) {
  if (value == null) {
    value = 0;
  }
  final Uint8List list = Uint8List(4);
  final buffer = ByteData.view(list.buffer, list.offsetInBytes);
  buffer.setInt32(0, value, Endian.host);
  return RawSocketOption(level, option, list);
}