|
|
Representing half of a two-way UDP connection, the UDP transmitter can broadcast data to another selected peer host or to an entire subnet.
UDPTransmit ()
| UDPTransmit |
[protected]
Create a UDP transmitter.
UDPTransmit (const InetAddress &bind, tpport_t port = 5005)
| UDPTransmit |
[protected]
Create a UDP transmitter, bind it to a specific interface and port address so that other UDP sockets on remote machines (or the same host) may find and send UDP messages to it, and associate it with a given port on a peer host. On failure to bind, an exception is thrown. This class is only used to build the UDP Duplex.
Parameters:
bind | address to bind this socket to. |
port | number to bind this socket to. |
port | number on peer host to associate with. |
sockerror_t Connect (const InetHostAddress &host, tpport_t port)
| Connect |
[protected]
Associate this socket with a specified peer host. The port number from the constructor will be used. All UDP packets will be sent to and received from the specified host.
Parameters:
host | address to connect socket to. |
Returns: 0 on success, -1 on error.
sockerror_t Connect (const BroadcastAddress &subnet, tpport_t port)
| Connect |
[protected]
Associate this socket with a subnet of peer hosts for subnet broadcasting. The server must be able to assert broadcast permission for the socket.
Parameters:
subnet | address to broadcast into. |
Returns: 0 on success, -1 on error.
sockerror_t Connect (const InetMcastAddress &group, tpport_t port)
| Connect |
[protected]
Associate this socket with a multicast group.
Parameters:
mgroup | address of the multicast group to send to. |
port | port number |
Returns: 0 on success, -1 on error.
sockerror_t Disconnect (void)
| Disconnect |
[protected]
Disassociate this socket from any host connection. No data should be read or written until a connection is established.
inline int Send (const void *buf, int len)
| Send |
[protected]
Transmit "send" to use "connected" send rather than sendto.
Parameters:
address | of buffer to send. |
len | of bytes to send. |
Returns: number of bytes sent.
Reimplemented from UDPSocket.
inline void endTransmitter (void)
| endTransmitter |
[protected]
Stop transmitter.
inline SOCKET getTransmitter (void)
| getTransmitter |
[protected]
inline sockerror_t setMulticast (bool enable)
| setMulticast |
[protected]
Reimplemented from Socket.
inline sockerror_t setTimeToLive (unsigned char ttl)
| setTimeToLive |
[protected]
Reimplemented from Socket.
inline int Transmit (const char *buffer, size_t len)
| Transmit |
Transmit "send" to use "connected" send rather than sendto.
@note Windows does not support MSG_DONTWAIT, so it is defined as 0 on that platform.
Parameters:
address | of buffer to send. |
len | of bytes to send. |
Returns: number of bytes sent.
inline bool isOutputReady (unsigned long timeout = 0l)
| isOutputReady |
See if output queue is empty for sending more packets.
Parameters:
timeout | in milliseconds to wait. |
Returns: true if output available.
inline sockerror_t setRouting (bool enable)
| setRouting |
Reimplemented from Socket.
inline sockerror_t setTypeOfService (socktos_t tos)
| setTypeOfService |
Reimplemented from Socket.
inline sockerror_t setBroadcast (bool enable)
| setBroadcast |
Reimplemented from Socket.