class UDPTransmit

Unreliable Datagram Peer Associations. More...

Full nameost::UDPTransmit
Definition#include <socket.h>
Inheritsost::UDPSocket [private ]
Inherited byUDPDuplex
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Protected Methods


Detailed Description

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:
bindaddress to bind this socket to.
portnumber to bind this socket to.
portnumber 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:
hostaddress 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:
subnetaddress 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:
mgroupaddress of the multicast group to send to.
portport 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:
addressof buffer to send.
lenof 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:
addressof buffer to send.
lenof 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:
timeoutin 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.