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

dsSSLSocket Class Reference

#include <dsSSLSocket.h>

Inheritance diagram for dsSSLSocket:

dsSocket dsSocketBase List of all members.

Public Methods

 dsSSLSocket (char *host, int port)
 dsSSLSocket ()
 ~dsSSLSocket ()
virtual void Connect (char *host, int port, int proto=IPPROTO_TCP)
virtual void Close ()
X509 * getPeerCert ()
void Open (const int proto=IPPROTO_UDP, const int fcntl_flags=0)
virtual void Connect (const char *host, const int port, const int proto=IPPROTO_TCP)
virtual size_t __sendto (const char *buf, size_t bytes, const sockaddr *to, socklen_t len)
size_t Sendto (const char *ptr, size_t bytes, const char *host, const int port)
unsigned long getip ()
unsigned long getpeerip ()
unsigned int getport ()
char * getpeer_aip ()
char * get_aip ()
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)
virtual size_t __write (const char *ptr, size_t bytes)

Protected Attributes

sockaddr_in _sockAddr
hostent * _pHostEnt
int _sock

Detailed Description

Convenience shell to socket operations


Constructor & Destructor Documentation

dsSSLSocket::dsSSLSocket char *    host,
int    port
 

dsSSLSocket::dsSSLSocket  
 

dsSSLSocket::~dsSSLSocket  
 


Member Function Documentation

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

Reimplemented from dsSocket.

size_t dsSocket::__sendto const char *    buf,
size_t    bytes,
const sockaddr *    to,
socklen_t    len
[virtual, inherited]
 

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

Reimplemented from dsSocket.

void dsSSLSocket::Close   [virtual]
 

Reimplemented from dsSocket.

void dsSocket::Connect const char *    host,
const int    port,
const int    proto = IPPROTO_TCP
[virtual, inherited]
 

Don't add O_NONBLOCK by default because it require another way of error * and timeout handling

If I chouse to set O_NONBLOCK by default, code should looks like this:

#ifdef POSIX_OS int fl = fcntl(_sock, F_GETFL, 0); fcntl(_sock, F_SETFL, fl | O_NONBLOCK); #endif

Implements dsSocketBase.

void dsSSLSocket::Connect char *    host,
int    port,
int    proto = IPPROTO_TCP
[virtual]
 

int dsSocketBase::fd   const [inline, inherited]
 

char * dsSocket::get_aip   [inherited]
 

unsigned long dsSocket::getip   [inherited]
 

char * dsSocket::getpeer_aip   [inherited]
 

X509 * dsSSLSocket::getPeerCert  
 

unsigned long dsSocket::getpeerip   [inherited]
 

unsigned int dsSocket::getport   [inherited]
 

void dsSocket::Open const int    proto = IPPROTO_UDP,
const int    fcntl_flags = 0
[inherited]
 

size_t dsSocketBase::Printf const char *    format,
...   
[inherited]
 

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

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

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
[inherited]
 

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

ReadLine

Parameters:
os stream to store data
sec maximal wait time

size_t dsSocket::Sendto const char *    ptr,
size_t    bytes,
const char *    host,
const int    port
[inherited]
 

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

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

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

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

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


Member Data Documentation

struct hostent* dsSocket::_pHostEnt [protected, inherited]
 

int dsSocketBase::_sock [protected, inherited]
 

struct sockaddr_in dsSocket::_sockAddr [protected, inherited]
 


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