Extend datagram socket API.
Adds .setTargetAddress() and makes .getXAddress() work for datagram sockets, too.
This commit is contained in:
parent
2e5b13ee98
commit
1d330d6330
3 changed files with 15 additions and 6 deletions
|
@ -157,10 +157,10 @@ interface EventDriverSockets {
|
|||
ConnectionState getConnectionState(StreamSocketFD sock);
|
||||
|
||||
/// Retrieves the bind address of a socket.
|
||||
bool getLocalAddress(StreamSocketFD sock, scope RefAddress dst);
|
||||
bool getLocalAddress(SocketFD sock, scope RefAddress dst);
|
||||
|
||||
/// Retrieves the address of the connected peer.
|
||||
bool getRemoteAddress(StreamSocketFD sock, scope RefAddress dst);
|
||||
bool getRemoteAddress(SocketFD sock, scope RefAddress dst);
|
||||
|
||||
/// Sets the `TCP_NODELAY` option on a socket
|
||||
void setTCPNoDelay(StreamSocketFD socket, bool enable);
|
||||
|
@ -248,6 +248,10 @@ interface EventDriverSockets {
|
|||
*/
|
||||
DatagramSocketFD adoptDatagramSocket(int socket);
|
||||
|
||||
/** Sets an address to use as the default target address for sent datagrams.
|
||||
*/
|
||||
void setTargetAddress(DatagramSocketFD socket, scope Address target_address);
|
||||
|
||||
/// Sets the `SO_BROADCAST` socket option.
|
||||
bool setBroadcast(DatagramSocketFD socket, bool enable);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue