EasyUDPSocket class

EasyUDPSocket is a wrapper over RawDatagramSocket to make life easier.

Constructors

EasyUDPSocket(RawDatagramSocket rawSocket)
create an EasyUDPSocket with a RawDatagramSocket

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
rawSocket RawDatagramSocket
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

close() Future<void>
close the socket.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
receive({int timeout, bool explode = false}) Future<Datagram>
receive a Datagram from the socket.
send(List<int> buffer, dynamic address, int port) Future<int>
send some data with this socket.
sendBack(Datagram datagram, List<int> buffer) int
use sendBack to send message to where a Datagram comes from. This is a shorthand of socket.send(somedata, datagram.address, datagram.port);
toString() String
A string representation of this object. [...]
inherited

Operators

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

Static Methods

bind(dynamic host, int port, {bool reuseAddress = true, bool reusePort = false, int ttl = 1}) Future<EasyUDPSocket>
create an EasyUDPSocket and bind to host:port
bindBroadcast(int port, [bool reusePort = false]) Future<EasyUDPSocket>
bindMulticast(String ip, int port, [bool reusePort = false]) Future<EasyUDPSocket>
bindRandom(dynamic host, {bool reuseAddress = true, bool reusePort = false, int ttl = 1}) Future<EasyUDPSocket>
create an EasyUDPSocket and bind to random port.
bindSimple(int port, [bool reusePort = false]) Future<EasyUDPSocket>