Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
basic_netbuf< charT, traits > Class Template Reference
Inheritance diagram for basic_netbuf< charT, traits >:
Detailed Descriptiontemplate<class charT, class traits = std::char_traits<charT>>
|
Classes | |
struct | SetScope |
this allows us to reset status variables like openInProgress if a thread cancel occurs More... | |
Public Types | |
typedef charT | char_type |
typedef traits::int_type | int_type |
typedef traits::pos_type | pos_type |
typedef traits::off_type | off_type |
typedef traits | traits_type |
Public Member Functions | |
basic_netbuf () | |
basic_netbuf (const IPaddr &addr, bool datagram=false) | |
basic_netbuf (const IPaddr::ipname_t &host, const IPaddr::ipport_t port, bool datagram=false) | |
basic_netbuf (size_t buf_in_size, size_t buf_out_size) | |
virtual | ~basic_netbuf () |
virtual bool | open (const IPaddr &addr, bool datagram=false) |
virtual bool | open (const IPaddr::ipname_t &str, bool datagram=false) |
virtual bool | open (const IPaddr::ipname_t &ahost, unsigned int aPort, bool datagram=false) |
virtual bool | listen (unsigned int aPort, bool datagram=false) |
virtual bool | listen (const IPaddr &addr, bool datagram=false) |
virtual bool | is_connecting () const |
virtual bool | is_open () const |
virtual void | update_status () |
virtual void | close () |
virtual void | reset () |
virtual int | adoptFD (int fd) |
virtual void | setReconnect (bool doReconnect) |
virtual bool | getReconnect () const |
virtual void | setEcho (bool val=true) |
virtual bool | getEcho () |
virtual const IPaddr & | getPeerAddress () const |
virtual const IPaddr & | getLocalAddress () const |
virtual void | in_sync () |
virtual void | out_flush () |
Protected Member Functions | |
virtual void | reconnect () |
void | Init () |
void | Init (size_t insize, size_t outsize) |
basic_netbuf * | rdbuf () |
virtual std::streamsize | showmanyc () |
virtual int_type | underflow () |
virtual int_type | uflow () |
virtual int_type | overflow (int_type c=traits::eof()) |
virtual pos_type | seekoff (off_type off, std::ios_base::seekdir way, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out) |
virtual pos_type | seekpos (pos_type sp, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out) |
virtual int | sync () |
Static Protected Member Functions | |
static void | printBuffer (const char *buf, int buflen, const char *header, const char *prefix) |
Protected Attributes | |
charT * | buf_in |
charT * | buf_out |
bool | using_buf_in |
bool | using_buf_out |
int | sock |
bool | openInProgress |
bool | canRead |
bool | canWrite |
bool | is_echoing |
bool | autoReconnect |
bool | sockFromServer |
IPaddr | peerAddress |
IPaddr | localAddress |
IPaddr | tgtAddress |
bool | isDatagram |
Static Protected Attributes | |
static const int | INVALID_SOCKET = -1 |
static const size_t | def_buf_in_size = (1<<14)-28 |
static const size_t | def_buf_out_size = (1<<14)-28 |
Private Member Functions | |
basic_netbuf (const basic_netbuf &) | |
basic_netbuf & | operator= (const basic_netbuf &) |
assignment, don't call | |
Friends | |
class | netstream_server |
typedef charT basic_netbuf< charT, traits >::char_type |
Definition at line 107 of file netstream.h.
typedef traits::int_type basic_netbuf< charT, traits >::int_type |
Definition at line 108 of file netstream.h.
typedef traits::off_type basic_netbuf< charT, traits >::off_type |
Definition at line 110 of file netstream.h.
typedef traits::pos_type basic_netbuf< charT, traits >::pos_type |
Definition at line 109 of file netstream.h.
typedef traits basic_netbuf< charT, traits >::traits_type |
Definition at line 111 of file netstream.h.
basic_netbuf< charT, traits >::basic_netbuf | ( | ) |
Definition at line 394 of file netstream.h.
basic_netbuf< charT, traits >::basic_netbuf | ( | const IPaddr & | addr, | |
bool | datagram = false | |||
) |
Definition at line 401 of file netstream.h.
basic_netbuf< charT, traits >::basic_netbuf | ( | const IPaddr::ipname_t & | host, | |
const IPaddr::ipport_t | port, | |||
bool | datagram = false | |||
) |
Definition at line 410 of file netstream.h.
basic_netbuf< charT, traits >::basic_netbuf | ( | size_t | buf_in_size, | |
size_t | buf_out_size | |||
) |
Definition at line 419 of file netstream.h.
basic_netbuf< charT, traits >::~basic_netbuf | ( | ) | [virtual] |
Definition at line 427 of file netstream.h.
basic_netbuf< charT, traits >::basic_netbuf | ( | const basic_netbuf< charT, traits > & | ) | [private] |
virtual int basic_netbuf< charT, traits >::adoptFD | ( | int | fd | ) | [virtual] |
Definition at line 134 of file netstream.h.
void basic_netbuf< charT, traits >::close | ( | ) | [virtual] |
Definition at line 726 of file netstream.h.
Referenced by basic_netbuf< charT, traits >::in_sync(), basic_netbuf< charT, traits >::listen(), basic_netbuf< charT, traits >::open(), basic_netbuf< charT, traits >::out_flush(), basic_netbuf< charT, traits >::reset(), basic_netbuf< charT, traits >::update_status(), and basic_netbuf< charT, traits >::~basic_netbuf().
virtual bool basic_netbuf< charT, traits >::getEcho | ( | ) | [virtual] |
Definition at line 140 of file netstream.h.
virtual const IPaddr& basic_netbuf< charT, traits >::getLocalAddress | ( | ) | const [virtual] |
Definition at line 143 of file netstream.h.
virtual const IPaddr& basic_netbuf< charT, traits >::getPeerAddress | ( | ) | const [virtual] |
Definition at line 142 of file netstream.h.
virtual bool basic_netbuf< charT, traits >::getReconnect | ( | ) | const [virtual] |
Definition at line 137 of file netstream.h.
void basic_netbuf< charT, traits >::in_sync | ( | ) | [virtual] |
Definition at line 765 of file netstream.h.
Referenced by basic_netbuf< charT, traits >::uflow(), and basic_netbuf< charT, traits >::underflow().
void basic_netbuf< charT, traits >::Init | ( | size_t | insize, | |
size_t | outsize | |||
) | [protected] |
Definition at line 441 of file netstream.h.
void basic_netbuf< charT, traits >::Init | ( | ) | [protected] |
Definition at line 148 of file netstream.h.
Referenced by basic_netbuf< charT, traits >::basic_netbuf(), and basic_netbuf< charT, traits >::Init().
virtual bool basic_netbuf< charT, traits >::is_connecting | ( | ) | const [virtual] |
Definition at line 128 of file netstream.h.
virtual bool basic_netbuf< charT, traits >::is_open | ( | ) | const [virtual] |
Definition at line 129 of file netstream.h.
Referenced by basic_netbuf< charT, traits >::close(), basic_netbuf< charT, traits >::in_sync(), basic_netbuf< charT, traits >::listen(), basic_netbuf< charT, traits >::open(), basic_netbuf< charT, traits >::out_flush(), basic_netbuf< charT, traits >::overflow(), basic_netbuf< charT, traits >::showmanyc(), basic_netbuf< charT, traits >::sync(), basic_netbuf< charT, traits >::update_status(), and basic_netbuf< charT, traits >::~basic_netbuf().
bool basic_netbuf< charT, traits >::listen | ( | const IPaddr & | addr, | |
bool | datagram = false | |||
) | [virtual] |
Definition at line 607 of file netstream.h.
virtual bool basic_netbuf< charT, traits >::listen | ( | unsigned int | aPort, | |
bool | datagram = false | |||
) | [virtual] |
Definition at line 126 of file netstream.h.
Referenced by basic_netbuf< charT, traits >::listen(), and basic_netbuf< charT, traits >::reconnect().
virtual bool basic_netbuf< charT, traits >::open | ( | const IPaddr::ipname_t & | ahost, | |
unsigned int | aPort, | |||
bool | datagram = false | |||
) | [virtual] |
Definition at line 125 of file netstream.h.
Referenced by basic_netbuf< charT, traits >::open().
bool basic_netbuf< charT, traits >::open | ( | const IPaddr::ipname_t & | str, | |
bool | datagram = false | |||
) | [virtual] |
Definition at line 715 of file netstream.h.
bool basic_netbuf< charT, traits >::open | ( | const IPaddr & | addr, | |
bool | datagram = false | |||
) | [virtual] |
Definition at line 518 of file netstream.h.
Referenced by basic_netbuf< charT, traits >::basic_netbuf(), basic_netbuf< charT, traits >::open(), and basic_netbuf< charT, traits >::reconnect().
basic_netbuf& basic_netbuf< charT, traits >::operator= | ( | const basic_netbuf< charT, traits > & | ) | [private] |
assignment, don't call
void basic_netbuf< charT, traits >::out_flush | ( | ) | [virtual] |
Definition at line 828 of file netstream.h.
Referenced by basic_netbuf< charT, traits >::overflow(), basic_netbuf< charT, traits >::sync(), and basic_netbuf< charT, traits >::~basic_netbuf().
basic_netbuf< charT, traits >::int_type basic_netbuf< charT, traits >::overflow | ( | int_type | c = traits::eof() |
) | [protected, virtual] |
Definition at line 906 of file netstream.h.
void basic_netbuf< charT, traits >::printBuffer | ( | const char * | buf, | |
int | buflen, | |||
const char * | header, | |||
const char * | prefix | |||
) | [static, protected] |
Definition at line 748 of file netstream.h.
Referenced by basic_netbuf< charT, traits >::in_sync(), and basic_netbuf< charT, traits >::out_flush().
basic_netbuf* basic_netbuf< charT, traits >::rdbuf | ( | ) | [protected] |
Definition at line 150 of file netstream.h.
void basic_netbuf< charT, traits >::reconnect | ( | ) | [protected, virtual] |
Definition at line 738 of file netstream.h.
Referenced by basic_netbuf< charT, traits >::in_sync(), basic_netbuf< charT, traits >::out_flush(), basic_netbuf< charT, traits >::reset(), and basic_netbuf< charT, traits >::update_status().
virtual void basic_netbuf< charT, traits >::reset | ( | ) | [virtual] |
Definition at line 132 of file netstream.h.
basic_netbuf< charT, traits >::pos_type basic_netbuf< charT, traits >::seekoff | ( | off_type | off, | |
std::ios_base::seekdir | way, | |||
std::ios_base::openmode | which = std::ios_base::in | std::ios_base::out | |||
) | [protected, virtual] |
Definition at line 925 of file netstream.h.
Referenced by basic_netbuf< charT, traits >::seekpos().
virtual pos_type basic_netbuf< charT, traits >::seekpos | ( | pos_type | sp, | |
std::ios_base::openmode | which = std::ios_base::in | std::ios_base::out | |||
) | [protected, virtual] |
Definition at line 183 of file netstream.h.
virtual void basic_netbuf< charT, traits >::setEcho | ( | bool | val = true |
) | [virtual] |
Definition at line 139 of file netstream.h.
virtual void basic_netbuf< charT, traits >::setReconnect | ( | bool | doReconnect | ) | [virtual] |
Definition at line 136 of file netstream.h.
std::streamsize basic_netbuf< charT, traits >::showmanyc | ( | ) | [protected, virtual] |
Definition at line 873 of file netstream.h.
int basic_netbuf< charT, traits >::sync | ( | ) | [protected, virtual] |
Definition at line 965 of file netstream.h.
basic_netbuf< charT, traits >::int_type basic_netbuf< charT, traits >::uflow | ( | ) | [protected, virtual] |
Definition at line 893 of file netstream.h.
basic_netbuf< charT, traits >::int_type basic_netbuf< charT, traits >::underflow | ( | ) | [protected, virtual] |
Definition at line 883 of file netstream.h.
void basic_netbuf< charT, traits >::update_status | ( | ) | [virtual] |
Definition at line 454 of file netstream.h.
Referenced by basic_netbuf< charT, traits >::adoptFD(), basic_netbuf< charT, traits >::in_sync(), basic_netbuf< charT, traits >::out_flush(), and basic_netbuf< charT, traits >::showmanyc().
friend class netstream_server [friend] |
Definition at line 104 of file netstream.h.
bool basic_netbuf< charT, traits >::autoReconnect [protected] |
Definition at line 207 of file netstream.h.
Referenced by basic_netbuf< charT, traits >::getReconnect(), basic_netbuf< charT, traits >::in_sync(), basic_netbuf< charT, traits >::listen(), basic_netbuf< charT, traits >::open(), basic_netbuf< charT, traits >::out_flush(), basic_netbuf< charT, traits >::setReconnect(), basic_netbuf< charT, traits >::update_status(), and basic_netbuf< charT, traits >::~basic_netbuf().
charT* basic_netbuf< charT, traits >::buf_in [protected] |
Definition at line 198 of file netstream.h.
Referenced by basic_netbuf< charT, traits >::Init(), and basic_netbuf< charT, traits >::~basic_netbuf().
charT * basic_netbuf< charT, traits >::buf_out [protected] |
Definition at line 198 of file netstream.h.
Referenced by basic_netbuf< charT, traits >::Init(), and basic_netbuf< charT, traits >::~basic_netbuf().
bool basic_netbuf< charT, traits >::canRead [protected] |
Definition at line 204 of file netstream.h.
Referenced by basic_netbuf< charT, traits >::showmanyc(), and basic_netbuf< charT, traits >::update_status().
bool basic_netbuf< charT, traits >::canWrite [protected] |
Definition at line 205 of file netstream.h.
Referenced by basic_netbuf< charT, traits >::update_status().
const size_t basic_netbuf< charT, traits >::def_buf_in_size = (1<<14)-28 [static, protected] |
Definition at line 200 of file netstream.h.
Referenced by basic_netbuf< charT, traits >::Init().
const size_t basic_netbuf< charT, traits >::def_buf_out_size = (1<<14)-28 [static, protected] |
Definition at line 201 of file netstream.h.
Referenced by basic_netbuf< charT, traits >::Init().
const int basic_netbuf< charT, traits >::INVALID_SOCKET = -1 [static, protected] |
Definition at line 197 of file netstream.h.
Referenced by basic_netbuf< charT, traits >::close(), basic_netbuf< charT, traits >::is_open(), and basic_netbuf< charT, traits >::update_status().
bool basic_netbuf< charT, traits >::is_echoing [protected] |
Definition at line 206 of file netstream.h.
Referenced by basic_netbuf< charT, traits >::getEcho(), basic_netbuf< charT, traits >::in_sync(), basic_netbuf< charT, traits >::out_flush(), and basic_netbuf< charT, traits >::setEcho().
bool basic_netbuf< charT, traits >::isDatagram [protected] |
Definition at line 213 of file netstream.h.
Referenced by basic_netbuf< charT, traits >::in_sync(), basic_netbuf< charT, traits >::listen(), basic_netbuf< charT, traits >::open(), basic_netbuf< charT, traits >::out_flush(), and basic_netbuf< charT, traits >::reconnect().
IPaddr basic_netbuf< charT, traits >::localAddress [protected] |
Definition at line 211 of file netstream.h.
Referenced by basic_netbuf< charT, traits >::getLocalAddress(), basic_netbuf< charT, traits >::listen(), and basic_netbuf< charT, traits >::open().
bool basic_netbuf< charT, traits >::openInProgress [protected] |
Definition at line 203 of file netstream.h.
Referenced by basic_netbuf< charT, traits >::is_connecting(), basic_netbuf< charT, traits >::listen(), and basic_netbuf< charT, traits >::open().
IPaddr basic_netbuf< charT, traits >::peerAddress [protected] |
Definition at line 210 of file netstream.h.
Referenced by basic_netbuf< charT, traits >::getPeerAddress(), basic_netbuf< charT, traits >::in_sync(), basic_netbuf< charT, traits >::listen(), basic_netbuf< charT, traits >::open(), and basic_netbuf< charT, traits >::out_flush().
int basic_netbuf< charT, traits >::sock [protected] |
Definition at line 202 of file netstream.h.
Referenced by basic_netbuf< charT, traits >::adoptFD(), basic_netbuf< charT, traits >::close(), basic_netbuf< charT, traits >::in_sync(), basic_netbuf< charT, traits >::is_open(), basic_netbuf< charT, traits >::listen(), basic_netbuf< charT, traits >::open(), basic_netbuf< charT, traits >::out_flush(), and basic_netbuf< charT, traits >::update_status().
bool basic_netbuf< charT, traits >::sockFromServer [protected] |
Definition at line 208 of file netstream.h.
Referenced by basic_netbuf< charT, traits >::listen(), basic_netbuf< charT, traits >::open(), and basic_netbuf< charT, traits >::reconnect().
IPaddr basic_netbuf< charT, traits >::tgtAddress [protected] |
Definition at line 212 of file netstream.h.
Referenced by basic_netbuf< charT, traits >::listen(), basic_netbuf< charT, traits >::open(), and basic_netbuf< charT, traits >::reconnect().
bool basic_netbuf< charT, traits >::using_buf_in [protected] |
Definition at line 199 of file netstream.h.
Referenced by basic_netbuf< charT, traits >::Init(), and basic_netbuf< charT, traits >::~basic_netbuf().
bool basic_netbuf< charT, traits >::using_buf_out [protected] |
Definition at line 199 of file netstream.h.
Referenced by basic_netbuf< charT, traits >::Init(), and basic_netbuf< charT, traits >::~basic_netbuf().
Tekkotsu v5.1CVS |
Generated Mon May 9 04:59:05 2016 by Doxygen 1.6.3 |