Skip to main content
Version: 2.x

Sockets

Nodes to open sockets between peers of a room and send reliable or unreliable data over them.

Functions​

NodeTypeDescription
Construct SocketCallable functionCreates an empty socket object.
Create SocketCallable functionOpens the socket in a room.
Get LabelPure functionReturns the label the socket was created with.
Get Named LabelPure functionReturns the label the socket was created with, as a Name.
Get Remote Peer IdPure functionReturns the peer on the other end of the socket, or 0 for a socket to all peers.
Get Socket InfoPure functionReturns information about the socket: room, kind, direction, remote peer, label, priority and the number of unsent bytes.
Is ReadyPure functionChecks socket and socket info.
Reset SocketCallable functionCloses the native socket.
SendCallable functionSends a byte array to the peer (or peers) on the other end of the socket.
Send StringCallable functionSends a string, encoded as UTF-8, to the peer (or peers) on the other end of the socket.

Events​

EventRaised byDescription
On Socket Message ReceivedOdin SocketRaised when a message arrives on this socket.