skstream
Public Member Functions | Protected Member Functions | Protected Attributes
dgram_socketbuf Class Reference

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

#include <skstream.h>

Inheritance diagram for dgram_socketbuf:
socketbuf

List of all members.

Public Member Functions

 dgram_socketbuf (SOCKET_TYPE sock, std::streamsize insize=0x8000, std::streamsize outsize=0x8000)
 dgram_socketbuf (SOCKET_TYPE sock, std::streambuf::char_type *buf, std::streamsize length)
virtual ~dgram_socketbuf ()
 Destroy the socket buffer.
bool setTarget (const std::string &address, unsigned port, int proto)
void setOutpeer (const sockaddr_storage &peer)
const sockaddr_storage & getOutpeer () const
const sockaddr_storage & getInpeer () const
SOCKLEN getOutpeerSize () const
SOCKLEN getInpeerSize () const

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 Attributes

sockaddr_storage out_peer
 Target address of datagrams sent via this stream.
sockaddr_storage in_peer
 Source address of last datagram received by this stream.
SOCKLEN out_p_size
 Size of target address.
SOCKLEN in_p_size
 Size of source address.

Detailed Description

A stream buffer class that handles datagram sockets.


Constructor & Destructor Documentation

dgram_socketbuf::dgram_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.

dgram_socketbuf::dgram_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.


Member Function Documentation

int_type dgram_socketbuf::overflow ( int_type  nCh = traits_type::eof()) [protected, virtual]

Handle writing data from the buffer to the socket.

Handle output to a connected socket.

Implements socketbuf.

References out_p_size, and out_peer.


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