#include <wvudp.h>
Inheritance diagram for WvUDPStream:
Public Member Functions | |
WvUDPStream (const WvIPPortAddr &_local, const WvIPPortAddr &_rem) | |
virtual | ~WvUDPStream () |
const WvAddr * | local () const |
virtual const WvAddr * | src () const |
void | setdest (const WvIPPortAddr &_remaddr) |
void | enable_broadcasts () |
WvUDPStream (const WvIPPortAddr &_local, const WvIPPortAddr &_rem) | |
virtual | ~WvUDPStream () |
const WvAddr * | local () const |
virtual const WvAddr * | src () const |
void | setdest (const WvIPPortAddr &_remaddr) |
void | enable_broadcasts () |
Protected Member Functions | |
virtual size_t | uread (void *buf, size_t count) |
virtual size_t | uwrite (const void *buf, size_t count) |
virtual size_t | uread (void *buf, size_t count) |
virtual size_t | uwrite (const void *buf, size_t count) |
Protected Attributes | |
WvIPPortAddr | localaddr |
WvIPPortAddr | remaddr |
In the constructor, the socket is attached using bind() to the given _local address. If the address is 0.0.0.0, all addresses on the local host are used; if the port is 0, an available port number is chosen automatically.
If the _rem address is 0.0.0.0, the port is not connect()ed. That means it can receive packets from anywhere and send them to anywhere. The src() and setdest() functions are useful for this. If _rem is not 0.0.0.0, connect() is called and the socket will only accept data to/from the specified remote UDP address.
Buffering: all the usual WvStream-style input buffering is available, including getline(), but because input packets may get lost it is of limited usefulness. Buffering will cause particular confusion if the socket is not connect()ed.
Definition at line 30 of file include/wvudp.h.
|
connect a new socket Definition at line 13 of file wvudp.cc. References WvStream::getfd(), localaddr, WvStream::rwfd, WvStream::seterr(), WvIPPortAddr::sockaddr(), and WvIPAddr::sockaddr_len(). |
|
|
|
connect a new socket |
|
|
|
|
|
Definition at line 111 of file wvudp.cc. References WvStream::getfd(), and WvStream::isok(). |
|
|
|
Definition at line 69 of file wvudp.cc. References localaddr. |
|
Definition at line 47 of file ipstreams/wvudp.h. References remaddr. |
|
Definition at line 47 of file include/wvudp.h. References remaddr. |
|
return the remote address (source of incoming packets, target of outgoing packets). This is the last host sent to or received from, whichever was more recent. Reimplemented from WvStream. |
|
return the remote address (source of incoming packets, target of outgoing packets). This is the last host sent to or received from, whichever was more recent. Reimplemented from WvStream. Definition at line 63 of file wvudp.cc. References remaddr. |
|
unbuffered I/O functions; these ignore the buffer, which is handled by read(). Don't call these functions unless you have a _really_ good reason. Reimplemented from WvStream. |
|
unbuffered I/O functions; these ignore the buffer, which is handled by read(). Don't call these functions unless you have a _really_ good reason. Reimplemented from WvStream. Definition at line 75 of file wvudp.cc. References WvStream::getfd(), WvStream::isok(), and remaddr. |
|
unbuffered I/O functions; these ignore the buffer, which is handled by write(). Don't call these functions unless you have a _really_ good reason. Reimplemented from WvStream. |
|
unbuffered I/O functions; these ignore the buffer, which is handled by write(). Don't call these functions unless you have a _really_ good reason. Reimplemented from WvStream. Definition at line 91 of file wvudp.cc. References WvStream::getfd(), WvStream::isok(), remaddr, WvStream::seterr(), WvIPPortAddr::sockaddr(), and WvIPAddr::sockaddr_len(). |
|
Definition at line 53 of file ipstreams/wvudp.h. Referenced by local(), and WvUDPStream(). |
|
Definition at line 53 of file ipstreams/wvudp.h. |