#include <conexus/nspr_udp.h>
Inheritance diagram for Conexus::NSPR::UDP:
Public Types | |
typedef ConexusPointer< UDP > | pointer |
typedef ConexusPointer< UDP > | pointer |
typedef ConexusPointer< UDP > | pointer |
Public Member Functions | |
IDIOSKOPOS_OBJECT (Conexus::NSPR::UDP) | |
virtual void | open () throw ( open_exception ) |
virtual void | bind () throw ( bind_exception ) |
virtual void | bind (Conexus::Address &a) throw ( bind_exception ) |
virtual void | close () throw ( close_exception ) |
virtual void | connect () throw ( connect_exception ) |
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 (Address &a) throw ( connect_exception ) |
virtual 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. | |
virtual bool | write_without_connect () const |
virtual bool | multicast_auto_join () const |
virtual void | set_multicast_auto_join (bool value=true) |
virtual int | multicast_hops () |
Returns the multicast ttl of the currently associated interface. | |
virtual void | set_multicast_hops (int hops) |
Sets the multicast ttl of the currently associated interface to hops. | |
virtual bool | multicast_loop () |
If true multicast packets are looped back to local sockets. | |
virtual void | set_multicast_loop (bool loop) |
If parameter loop is true then multicast packets are looped back to local sockets. | |
UDP (uint16_t localport=0, uint16_t remoteport=0) | |
virtual void | open () throw (open_exception) |
virtual void | bind () throw ( bind_exception ) |
virtual void | bind (Conexus::Address &a) throw ( bind_exception ) |
virtual void | close () throw ( close_exception ) |
virtual void | connect () throw ( connect_exception ) |
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 (Address &a) throw ( connect_exception ) |
virtual 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. | |
virtual bool | write_without_connect () const |
virtual bool | multicast_auto_join () const |
virtual void | set_multicast_auto_join (bool value=true) |
virtual int | multicast_hops () |
Returns the multicast ttl of the currently associated interface. | |
virtual void | set_multicast_hops (int hops) |
Sets the multicast ttl of the currently associated interface to hops. | |
virtual bool | multicast_loop () |
If true multicast packets are looped back to local sockets. | |
virtual 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 () |
UDP (uint16_t localport=0, uint16_t remoteport=0) | |
virtual void | open () throw (open_exception) |
virtual void | bind () throw ( bind_exception ) |
virtual void | bind (Conexus::Address &a) throw ( bind_exception ) |
virtual void | close () throw ( close_exception ) |
virtual void | connect () throw ( connect_exception ) |
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 (Address &a) throw ( connect_exception ) |
virtual 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. | |
virtual bool | write_without_connect () const |
virtual bool | multicast_auto_join () const |
virtual void | set_multicast_auto_join (bool value=true) |
virtual int | multicast_hops () |
Returns the multicast ttl of the currently associated interface. | |
virtual void | set_multicast_hops (int hops) |
Sets the multicast ttl of the currently associated interface to hops. | |
virtual bool | multicast_loop () |
If true multicast packets are looped back to local sockets. | |
virtual 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) |
static UDP::pointer | create (uint32_t interface, uint16_t localport, uint16_t remoteport) |
static UDP::pointer | create (const std::string &interface, uint16_t localport=0, uint16_t remoteport=0) |
static UDP::pointer | create (uint16_t localport=0, uint16_t remoteport=0) |
static UDP::pointer | create (uint16_t localport=0, uint16_t remoteport=0) |
Protected Member Functions | |
UDP (uint32_t interface, uint16_t localport, uint16_t remoteport) | |
UDP (const std::string &interface, uint16_t localport, uint16_t remoteport) | |
virtual void | join () |
Joins the multicast group specified by addr. | |
virtual void | leave () |
Leaves the multicast group specified by addr. | |
virtual ssize_t | write_data (long int timeout, Data::const_pointer data) throw (write_exception) |
virtual void | join () |
Joins the multicast group specified by addr. | |
virtual void | leave () |
Leaves the multicast group specified by addr. | |
virtual ssize_t | write_data (long int timeout, Data::const_pointer data) throw (write_exception) |
virtual Data::pointer | read_data (long int timeout, size_t s=0) throw (read_exception) |
virtual void | join () |
Joins the multicast group specified by addr. | |
virtual void | leave () |
Leaves the multicast group specified by addr. | |
virtual ssize_t | write_data (long int timeout, Data::const_pointer data) throw (write_exception) |
virtual Data::pointer | read_data (long int timeout, size_t s=0) throw (read_exception) |
Protected Attributes | |
bool | m_write_without_connect |
bool | m_multicast_auto_join |
bool | m_multicast_joined |
void Conexus::NSPR::UDP::connect | ( | ) | throw ( connect_exception ) [virtual] |
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::NSPR::Socket.
void Conexus::NSPR::UDP::set_write_without_connect | ( | bool | value = true |
) | [virtual] |
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 exception. 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 exceptions.
But, since this is contrary to RFC 1122 behavior you should really think about your design before setting this.
virtual void Conexus::NSPR::UDP::connect | ( | ) | throw ( connect_exception ) [virtual] |
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::NSPR::Socket.
virtual void Conexus::NSPR::UDP::set_write_without_connect | ( | bool | value = true |
) | [virtual] |
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 exception. 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 exceptions.
But, since this is contrary to RFC 1122 behavior you should really think about your design before setting this.
virtual void Conexus::NSPR::UDP::connect | ( | ) | throw ( connect_exception ) [virtual] |
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::NSPR::Socket.
virtual void Conexus::NSPR::UDP::set_write_without_connect | ( | bool | value = true |
) | [virtual] |
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 exception. 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 exceptions.
But, since this is contrary to RFC 1122 behavior you should really think about your design before setting this.