#include <wvtcp.h>
Inheritance diagram for WvTCPListener:
Public Methods | |
WvTCPListener (const WvIPPortAddr &_listenport) | |
virtual | ~WvTCPListener () |
virtual void | close () |
WvTCPConn * | accept () |
void | auto_accept (WvStreamList *list, WvStreamCallback callfunc=NULL, void *userdata=NULL) |
virtual size_t | uread (void *buf, size_t len) |
virtual size_t | uwrite (const void *buf, size_t len) |
virtual const WvIPPortAddr * | src () const |
WvTCPListener (const WvIPPortAddr &_listenport) | |
virtual | ~WvTCPListener () |
virtual void | close () |
WvTCPConn * | accept () |
void | auto_accept (WvStreamList *list, WvStreamCallback callfunc=NULL, void *userdata=NULL) |
virtual size_t | uread (void *buf, size_t len) |
virtual size_t | uwrite (const void *buf, size_t len) |
virtual const WvIPPortAddr * | src () const |
Static Protected Methods | |
void | accept_callback (WvStream &s, void *userdata) |
void | accept_callback (WvStream &s, void *userdata) |
Protected Attributes | |
WvIPPortAddr | listenport |
WvStreamList * | auto_list |
WvStreamCallback | auto_callback |
void * | auto_userdata |
WvStreamList * | auto_list |
void * | auto_userdata |
Definition at line 123 of file include/wvtcp.h.
|
Create a WvStream that listens on _listenport of the current machine This is how you set up a TCP Server. Definition at line 236 of file wvtcp.cc. References auto_list, auto_userdata, WvStream::getfd, listenport, WvIPPortAddr::port, WvStream::rwfd, WvStream::seterr, WvIPPortAddr::sockaddr, and WvIPAddr::sockaddr_len. |
|
Destructor - remember - close() is your friend ;) Definition at line 271 of file wvtcp.cc. References close. |
|
Create a WvStream that listens on _listenport of the current machine This is how you set up a TCP Server. |
|
Destructor - remember - close() is your friend ;) |
|
return a new WvTCPConn socket corresponding to a newly-accepted connection. If no connection is ready immediately, we wait for one indefinitely. You can use select(read=true) to check for a waiting connection. |
|
return a new WvTCPConn socket corresponding to a newly-accepted connection. If no connection is ready immediately, we wait for one indefinitely. You can use select(read=true) to check for a waiting connection. Definition at line 288 of file wvtcp.cc. References WvStream::getfd. Referenced by accept_callback. |
|
|
|
Definition at line 311 of file wvtcp.cc. References accept, WvList< WvStream >::append, auto_callback, auto_list, auto_userdata, WvStream::setcallback, and WvStream::userdata. Referenced by auto_accept. |
|
set a callback() function that automatically accepts new WvTCPConn connections, assigning them their own callback function 'callfunc' with parameter 'userdata.' Pass list==NULL or define your own own callback function to disable auto-accepting. Be careful not to accept() connections yourself if you do this, or we may end up accept()ing twice, causing a hang the second time. |
|
set a callback() function that automatically accepts new WvTCPConn connections, assigning them their own callback function 'callfunc' with parameter 'userdata.' Pass list==NULL or define your own own callback function to disable auto-accepting. Be careful not to accept() connections yourself if you do this, or we may end up accept()ing twice, causing a hang the second time. Definition at line 301 of file wvtcp.cc. References accept_callback, auto_callback, auto_list, auto_userdata, WvStream::setcallback, and WvStream::userdata. Referenced by main. |
|
Shut down the server, and disconnect from the port Reimplemented from WvStream. |
|
Shut down the server, and disconnect from the port Reimplemented from WvStream. Definition at line 278 of file wvtcp.cc. References WvStream::close. Referenced by ~WvTCPListener. |
|
src() is a bit of a misnomer, but it returns the listener port. Reimplemented from WvStream. |
|
src() is a bit of a misnomer, but it returns the listener port. Reimplemented from WvStream. Definition at line 333 of file wvtcp.cc. References listenport. |
|
these don't do anything, but they confuse the socket, so we'll ignore them on purpose. Reimplemented from WvStream. |
|
these don't do anything, but they confuse the socket, so we'll ignore them on purpose. 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. |
|
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 177 of file ipstreams/wvtcp.h. Referenced by accept_callback, and auto_accept. |
|
Definition at line 176 of file ipstreams/wvtcp.h. |
|
Definition at line 176 of file include/wvtcp.h. Referenced by accept_callback, auto_accept, and WvTCPListener. |
|
Definition at line 178 of file ipstreams/wvtcp.h. |
|
Definition at line 178 of file include/wvtcp.h. Referenced by accept_callback, auto_accept, and WvTCPListener. |
|
Definition at line 175 of file ipstreams/wvtcp.h. Referenced by src, and WvTCPListener. |