Enumeration of events for the Socket object.

Variables

@:value(cast "close")@:enum@:implinlineread onlyClose:SocketEvent<() ‑> Void> = "close"

Emitted when a socket is closed with close. No new message events will be emitted on this socket.

@:value(cast "error")@:enum@:implinlineread onlyError:SocketEvent<Error ‑> Void> = "error"

Emitted when an error occurs.

@:value(cast "listening")@:enum@:implinlineread onlyListening:SocketEvent<() ‑> Void> = "listening"

Emitted when a socket starts listening for datagrams. This happens as soon as UDP sockets are created.

@:value(cast "message")@:enum@:implinlineread onlyMessage:SocketEvent<MessageListener> = "message"

Emitted when a new datagram is available on a socket. Listener arguments:

msg - received data
rinfo - sender's address information and the number of bytes in the datagram