UDPNotify
Notifications for UDP connections.
For an example of using this class please see the documentatoin for the UDPSocket
actor.
interface ref UDPNotify
Public Functions
listening
Called when the socket has been bound to an address.
fun ref listening( sock: UDPSocket ref) : None val
Parameters
- sock: UDPSocket ref
Returns
- None val
not_listening
Called if it wasn't possible to bind the socket to an address.
It is expected to implement proper error handling. You need to opt in to ignoring errors, which can be implemented like this:
fun ref not_listening(sock: UDPSocket ref) => None
fun ref not_listening( sock: UDPSocket ref) : None val
Parameters
- sock: UDPSocket ref
Returns
- None val
received
Called when new data is received on the socket.
fun ref received( sock: UDPSocket ref, data: Array[U8 val] iso, from: NetAddress val) : None val
Parameters
- sock: UDPSocket ref
- data: Array[U8 val] iso
- from: NetAddress val
Returns
- None val
closed
Called when the socket is closed.
fun ref closed( sock: UDPSocket ref) : None val
Parameters
- sock: UDPSocket ref
Returns
- None val
© 2016-2020, The Pony Developers
© 2014-2015, Causality Ltd.
Licensed under the BSD 2-Clause License.
https://stdlib.ponylang.io/net-UDPNotify