Select your preferred scripting language. All code snippets will be displayed in this language.
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
ClosehostId | id of udp socket where event happened. |
connectionId | Device connected to. |
channelId | Channel id for data event. |
buffer | Data received over the network. |
bufferSize | Buffer size. |
receivedSize | Actually received length. |
error | Possible returned error. |
NetworkEventType Type of event returned from Receive().
Deliver network events to user.
The API process received data returned in the connection. The data is
returned in the buffer argument, with the number of bytes permitted set by the bufferSize
argument. The exact number of bytes returned is set in receivedSize.
kConnectionEvent will notify about new connection established,
kDisconnectEvent will report about disconnection happened, kDataEvent will report
about new information delivered.
See Connect for a code example.