AsyncUdpConnection
(Requires workerman >= 3.0.8)
AsyncUdpConnection can be used as a UDP client to communicate with a remote UDP server.
Although UDP is connectionless, for ease of use, its naming conventions and interfaces are kept consistent with AsyncTcpConnection.
Note: Unlike AsyncTcpConnection, AsyncUdpConnection does not support the following properties or methods.
- No connection->id property
- No connection->worker property
- No connection->transport property
- No connection->maxSendBufferSize property
- No connection->defaultMaxSendBufferSize property
- No connection->maxPackageSize property
- No connection->onBufferFull callback
- No connection->onBufferDrain callback
- No connection->onError callback
- No connection->destroy() interface
- No connection->pauseRecv() interface
- No connection->resumeRecv() interface
- No connection->pipe() interface
- No connection->reconnect() interface
Properties or methods supported by AsyncUdpConnection
- Supports connection->protocol property
- Supports connection->onMessage callback
- Supports connection->connect() method
- Supports connection->send() method
- Supports connection->getRemoteIp() method
- Supports connection->getRemotePort() method
- Supports connection->onClose callback.
Note: Since TCP is connection-oriented, typically when either party calls close to disconnect, both parties can trigger onClose. However, since UDP is connectionless, calling the connection->close() method will only trigger the local onClose callback and cannot trigger the remote onClose callback.