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
| Name | Type | Description |
|---|---|---|
| Target | Odin Room | The Odin Room to call this function on. |
| Target Peer Id | Integer64 | Remote PeerId, or 0 to broadcast to all peers in the room |
| Socket Kind | Odin Socket Kind | Kind of socket |
Outputs
| Name | Type | Description |
|---|---|---|
| Return Value | Odin Socket |