Skip to main content
Version: 2.x

Open Socket

Opens a socket to a peer in this room, or to all peers with a Target Peer Id of 0. Send data with Send or Send String on the returned socket. The receivers get it through On Socket on their room and On Socket Message Received on their socket.

  • Node type: Callable function. Has execution pins and runs when it is reached in the event graph.
  • Target: Odin Room
  • Menu category: Odin › Room › Socket
  • C++: UOdinRoom::OpenSocket
note

Sockets are bound to the current room session and do not survive a reconnect. Sockets to a specific peer are closed automatically when that peer leaves the room, since the server recycles peer ids and a stale socket could otherwise reach a later peer under the same id; broadcast sockets (target peer 0) stay open for the whole session.

Inputs​

NameTypeDescription
TargetOdin RoomThe Odin Room to call this function on.
Target Peer IdInteger64Remote PeerId, or 0 to broadcast to all peers in the room
Socket KindOdin Socket KindKind of socket

Outputs​

NameTypeDescription
Return ValueOdin Socket