#include <socket.h>
Inheritance diagram for SocketBuf:
Public Types | |
Enumerations | |
enum | type { sock_stream = SOCK_STREAM, sock_dgram = SOCK_DGRAM, sock_raw = SOCK_RAW, sock_seqpacket = SOCK_SEQPACKET } |
enum | option { so_debug = SO_DEBUG, so_acceptconn = SO_ACCEPTCONN, so_reuseaddr = SO_REUSEADDR, so_keepalive = SO_KEEPALIVE, so_dontroute = SO_DONTROUTE, so_broadcast = SO_BROADCAST, so_useloopback = SO_USELOOPBACK, so_linger = SO_LINGER, so_oobinline = SO_OOBINLINE, so_sndbuf = SO_SNDBUF, so_rcvbuf = SO_RCVBUF, so_sndlowat = SO_SNDLOWAT, so_rcvlowat = SO_RCVLOWAT, so_sndtimeo = SO_SNDTIMEO, so_rcvtimeo = SO_RCVTIMEO, so_error = SO_ERROR, so_type = SO_TYPE } |
enum | level { sol_socket = SOL_SOCKET } |
enum | msgflag { msg_oob = MSG_OOB, msg_peek = MSG_PEEK, msg_dontroute = MSG_DONTROUTE, msg_maxiovlen = MSG_MAXIOVLEN } |
enum | shuthow { shut_read, shut_write, shut_readwrite } |
enum | { somaxconn = SOMAXCONN } |
Public Member Functions | |
virtual SocketBuf * | open (type socket_type, int proto=0) throw () |
virtual SocketBuf * | close () throw () |
virtual int | sync () throw () |
virtual _G_ssize_t | sys_read (char *buf, _G_ssize_t len) throw () |
return EOF on eof, 0 on timeout, and number of chars read on success | |
virtual _G_ssize_t | sys_write (const void *buf, long len) throw () |
return written_length; < len indicates error | |
virtual std::streamsize | xsputn (const char *s, std::streamsize n) throw () |
int | is_open () const throw () |
int | is_eof () throw () |
virtual int | bind (SockAddr &) throw () |
virtual int | connect (SockAddr &) throw () |
void | listen (int num=somaxconn) throw () |
virtual SocketBuf | accept () throw () |
virtual SocketBuf | accept (SockAddr &sa) throw () |
int | read (void *buf, int len) throw () |
int | recv (void *buf, int len, int msgf=0) throw () |
int | recvfrom (SockAddr &sa, void *buf, int len, int msgf=0) throw () |
int | write (const void *buf, int len) throw () |
int | send (const void *buf, int len, int msgf=0) throw () |
int | sendto (SockAddr &sa, const void *buf, int len, int msgf=0) throw () |
int | sendtimeout (int wp=-1) throw () |
int | recvtimeout (int wp=-1) throw () |
int | is_readready (int wp_sec, int wp_usec=0) const throw () |
int | is_writeready (int wp_sec, int wp_usec=0) const throw () |
int | is_exceptionpending (int wp_sec, int wp_usec=0) const throw () |
void | shutdown (shuthow sh) throw () |
int | getopt (option op, void *buf, int len, level l=sol_socket) const throw () |
void | setopt (option op, void *buf, int len, level l=sol_socket) const throw () |
type | gettype () const throw () |
int | clearerror () const throw () |
int | debug (int opt=-1) const throw () |
int | reuseaddr (int opt=-1) const throw () |
int | keepalive (int opt=-1) const throw () |
int | dontroute (int opt=-1) const throw () |
int | broadcast (int opt=-1) const throw () |
int | oobinline (int opt=-1) const throw () |
int | linger (int tim=-1) const throw () |
int | sendbufsz (int sz=-1) const throw () |
int | recvbufsz (int sz=-1) const throw () |
Constructors and Destructors | |
SocketBuf (int soc=-1) throw () | |
SocketBuf (int domain, type socket_type, int proto=0) throw () | |
Detailed constructor. | |
SocketBuf (const SocketBuf &socket_buf) throw () | |
Copy constructor. | |
virtual | ~SocketBuf () throw () |
Destructor. | |
Assignment | |
SocketBuf & | operator= (const SocketBuf &) throw () |
Assignment operator. | |
Converters | |
operator int () const throw () | |
Convert this SocketBuf to int. | |
Protected Member Functions | |
virtual int | underflow () throw () |
virtual int | overflow (int c=EOF) throw () |
virtual int | doallocate () throw () |
int | flush_output () throw () |
Protected Attributes | |
sockcnt * | rep |
int | stmo |
int | rtmo |