Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

dsSocketBase Class Reference

Base class to all socket alike operation eg for Sockets, ttys etc. More...

#include <dsSocket.h>

Inheritance diagram for dsSocketBase:

dsLP dsSocket dsServerSocket dsSSLSocket List of all members.

Public Methods

 dsSocketBase ()
virtual void Connect (const char *host, const int port, const int proto)=0
virtual void Close ()=0
int fd () const
size_t Read (char *buffer, size_t bytes, int sec=10, int usec=0)
size_t Read (std::ostream &os, int sec=10, int usec=0)
size_t Write (const char *buffer, size_t bytes, int sec=10, int usec=0)
size_t Write (std::istream &is, int sec=10, int usec=0)
size_t Write (const char *str, int sec=10, int usec=0)
size_t Printf (const char *format,...)
size_t ReadLine (std::ostream &os, int sec=10)
size_t ReadLine (char *buf, size_t size, int sec=10)
size_t WriteLine (std::istream &is, int sec=10)
size_t WriteLine (const char *str, int sec=10)

Protected Methods

virtual size_t __read (char *buf, size_t bytes)=0
virtual size_t __write (const char *ptr, size_t bytes)=0

Protected Attributes

int _sock

Detailed Description


Constructor & Destructor Documentation

dsSocketBase::dsSocketBase  
 


Member Function Documentation

virtual size_t dsSocketBase::__read char *    buf,
size_t    bytes
[protected, pure virtual]
 

Implemented in dsLP, dsSocket, and dsSSLSocket.

virtual size_t dsSocketBase::__write const char *    ptr,
size_t    bytes
[protected, pure virtual]
 

Implemented in dsSocket, and dsSSLSocket.

virtual void dsSocketBase::Close   [pure virtual]
 

Implemented in dsLP, dsSocket, dsServerSocket, and dsSSLSocket.

virtual void dsSocketBase::Connect const char *    host,
const int    port,
const int    proto
[pure virtual]
 

Implemented in dsLP, and dsSocket.

int dsSocketBase::fd   const [inline]
 

size_t dsSocketBase::Printf const char *    format,
...   
 

size_t dsSocketBase::Read std::ostream &    os,
int    sec = 10,
int    usec = 0
 

size_t dsSocketBase::Read char *    buffer,
size_t    bytes,
int    sec = 10,
int    usec = 0
 

Read/Write data from network

The main difference from raw read/write, that socket covered by select and as result, these functions doesn't block for more than timeout.

size_t dsSocketBase::ReadLine char *    buf,
size_t    size,
int    sec = 10
 

size_t dsSocketBase::ReadLine std::ostream &    os,
int    sec = 10
 

ReadLine

Parameters:
os stream to store data
sec maximal wait time

size_t dsSocketBase::Write const char *    str,
int    sec = 10,
int    usec = 0
[inline]
 

size_t dsSocketBase::Write std::istream &    is,
int    sec = 10,
int    usec = 0
 

size_t dsSocketBase::Write const char *    buffer,
size_t    bytes,
int    sec = 10,
int    usec = 0
 

size_t dsSocketBase::WriteLine const char *    str,
int    sec = 10
 

size_t dsSocketBase::WriteLine std::istream &    is,
int    sec = 10
 


Member Data Documentation

int dsSocketBase::_sock [protected]
 


The documentation for this class was generated from the following files:
Generated on Mon May 16 18:27:00 2005 for libdms4 by doxygen1.3-rc2