skstream
Public Member Functions | Protected Member Functions | List of all members
stream_socketbuf Class Reference

A stream buffer class that handles stream sockets. More...

#include <skstream.h>

Inheritance diagram for stream_socketbuf:
socketbuf

Public Member Functions

 stream_socketbuf (SOCKET_TYPE sock, std::streamsize insize=0x8000, std::streamsize outsize=0x8000)
 
 stream_socketbuf (SOCKET_TYPE sock, std::streambuf::char_type *buf, std::streamsize length)
 
virtual ~stream_socketbuf ()
 Destroy the socket buffer.
 
- Public Member Functions inherited from socketbuf
 socketbuf (SOCKET_TYPE sock, std::streamsize insize=0x8000, std::streamsize outsize=0x8000)
 
 socketbuf (SOCKET_TYPE sock, std::streambuf::char_type *buf, std::streamsize length)
 
virtual ~socketbuf ()
 Destroy the socket buffer.
 
void setSocket (SOCKET_TYPE sock)
 Set the existing socket that this buffer should use.
 
SOCKET_TYPE getSocket () const
 Get the socket that this buffer uses.
 
void setReadTimeout (unsigned sec, unsigned usec=0)
 
void setWriteTimeout (unsigned sec, unsigned usec=0)
 
void setTimeout (unsigned sec, unsigned usec=0)
 
bool timeout () const
 Return the flag indicating whether a timeout has occured.
 

Protected Member Functions

virtual int_type overflow (int_type nCh=traits_type::eof())
 Handle writing data from the buffer to the socket.
 
virtual int_type underflow ()
 Handle reading data from the socket to the buffer.
 
- Protected Member Functions inherited from socketbuf
virtual int sync ()
 Flush the output buffer.
 
std::streambuf * setbuf (std::streambuf::char_type *buf, std::streamsize len)
 

Additional Inherited Members

- Protected Attributes inherited from socketbuf
SOCKET_TYPE _socket
 
timeval _underflow_timeout
 
timeval _overflow_timeout
 
bool Timeout
 

Detailed Description

A stream buffer class that handles stream sockets.

Constructor & Destructor Documentation

stream_socketbuf::stream_socketbuf ( SOCKET_TYPE  sock,
std::streamsize  insize = 0x8000,
std::streamsize  outsize = 0x8000 
)
explicit

Make a new socket buffer from an existing socket, with optional buffer sizes.

stream_socketbuf::stream_socketbuf ( SOCKET_TYPE  sock,
std::streambuf::char_type *  buf,
std::streamsize  length 
)

Make a new socket buffer from an existing socket, with an existing buffer.


The documentation for this class was generated from the following files: