RawSocketOption class

The RawSocketOption is used as a parameter to Socket.setRawOption and RawSocket.setRawOption to customize the behaviour of the underlying socket.

It allows for fine grained control of the socket options, and its values will be passed to the underlying platform's implementation of setsockopt and getsockopt.

Annotations
  • @Since("2.2")

Constructors

RawSocketOption(int level, int option, Uint8List value)
const
Creates a RawSocketOption for RawSocket.getRawOption and RawSocket.setRawOption. [...]
RawSocketOption.fromBool(int level, int option, bool value)
factory
Convenience constructor for creating a boolean based RawSocketOption.
RawSocketOption.fromInt(int level, int option, int value)
factory
Convenience constructor for creating an integer based RawSocketOption.

Properties

hashCodeint
read-only, inherited
The hash code for this object. [...]
levelint
final
The level for the option to set or get. [...]
optionint
final
The numeric ID of the option to set or get.
runtimeTypeType
read-only, inherited
A representation of the runtime type of the object.
valueUint8List
final
The raw data to set, or the array to write the current option value into. [...]

Methods

noSuchMethod(Invocation invocation) → dynamic
inherited
Invoked when a non-existent method or property is accessed. [...]
toString() → String
inherited
A string representation of this object. [...]

Operators

operator ==(Object other) → bool
inherited
The equality operator. [...]

Static Properties

IPv4MulticastInterfaceint
read-only
Socket option for IP_MULTICAST_IF.
IPv6MulticastInterfaceint
read-only
Socket option for IPV6_MULTICAST_IF.
levelIPv4int
read-only
Socket level option for IPPROTO_IP.
levelIPv6int
read-only
Socket level option for IPPROTO_IPV6.
levelSocketint
read-only
Socket level option for SOL_SOCKET.
levelTcpint
read-only
Socket level option for IPPROTO_TCP.
levelUdpint
read-only
Socket level option for IPPROTO_UDP.

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.13.0/dart-io/RawSocketOption-class.html