#include <conexus/ipv6_udp.h>
Inheritance diagram for Conexus::IPv6::UDP:
Public Types | |
typedef boost::shared_ptr< UDP > | pointer |
Public Member Functions | |
UDP (uint16_t localport=0, uint16_t remoteport=0) | |
virtual void | bind () throw (bind_error) |
virtual void | bind (Conexus::Address &a) throw (bind_error) |
virtual void | close () throw (close_error) |
int | pending_input_datagram_size () |
Returns the size in bytes of the next pending datagram, or 0 when no datagram is pending. | |
int | pending_output_datagram_size () |
Returns the size in bytes of the local send queue. | |
virtual ssize_t | write (const void *data, size_t size) throw (write_error) |
Overloads the Socket ancestor send method to ensure that the socket is connected before trying to send. | |
virtual Data | read (size_t s=-1) throw (read_error) |
Receives a single datagram from the UDP socket up to s bytes in size; allocates any memory necessary as a smart pointer contained in the returned Data object. | |
virtual void | connect () throw (connect_error) |
virtual void | connect (Address &a) throw (connect_error) |
void | set_write_without_connect (bool value=true) |
There are some circumstances in which it may be desirable to set a default address and have the send method transparently call the sendto method without connecting rather than connecting and calling the send method. | |
bool | write_without_connect () const |
bool | multicast_auto_join () const |
void | set_multicast_auto_join (bool value=true) |
int | multicast_hops () |
Returns the multicast ttl of the currently associated interface. | |
void | set_multicast_hops (int hops) |
Sets the multicast ttl of the currently associated interface to hops. | |
bool | multicast_loop () |
If true multicast packets are looped back to local sockets. | |
void | set_multicast_loop (bool loop) |
If parameter loop is true then multicast packets are looped back to local sockets. | |
virtual const std::string & | object_type () |
Static Public Member Functions | |
static UDP::pointer | create (uint16_t localport=0, uint16_t remoteport=0) |
Protected Member Functions | |
void | join () |
Joins the multicast group specified by addr. | |
void | leave () |
Leaves the multicast group specified by addr. | |
virtual void | on_local_interface_changed (unsigned which) |
virtual void | on_remote_address_changed (unsigned which) |
Protected Attributes | |
bool | m_write_without_connect |
bool | m_multicast_auto_join |
ipv6_mreq * | m_multicast_request |
|
Receives a single datagram from the UDP socket up to s bytes in size; allocates any memory necessary as a smart pointer contained in the returned Data object. If s < 0 then receives the next pending datagram, however large it may be. Reimplemented from Conexus::Socket. |
|
There are some circumstances in which it may be desirable to set a default address and have the send method transparently call the sendto method without connecting rather than connecting and calling the send method. A specific example of this is when the remote address/port may occassionally be unavailable. In this case the destination may generate an ICMP UNREACHABLE message, and in accordance with RFC 1122 the local machine will fail any future sends on a connected port, throwing a write::connection_refused error. If you want to ensure that the datagram is sent contrary to RFC 1122 you could set the default address, set send without connect and call send without throwing connection errors. But, since this is contrary to RFC 1122 behavior you should really think about your design before setting this. Reimplemented in Conexus::IPv6::UDPPoset. |