Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

SocketDescriptor Class Reference

Subclasses FileDescriptor to provide a general-purpose wrapper for BSD TCP or UDP server- or client-sockets. More...

#include <SocketDescriptor.h>

Inheritance diagram for SocketDescriptor:

Inheritance graph
[legend]
Collaboration diagram for SocketDescriptor:

Collaboration graph
[legend]
List of all members.

Public Methods

virtual void close ()
AddressAccessors
Accessors for local and remote address information for this socket.

string const& getLocalHostname () const
int getLocalPort () const
string const& getRemoteHostname () const
int getRemotePort () const

Protected Methods

virtual int lowlevel_read (int fd, char *buf, int len)
virtual int lowlevel_write (int fd, char const *buf, int len)
 SocketDescriptor (ref< FileDescriptorManager > const &_fdMgr, int _fd)
void setLocalAddr (string const &hostname, int port)
void setRemoteAddr (string const &hostname, int port)

Private Attributes

string hostname_local
int port_local
string hostname_remote
int port_remote

Friends

class  ServerSocketDescriptor

Detailed Description

Subclasses FileDescriptor to provide a general-purpose wrapper for BSD TCP or UDP server- or client-sockets.

Definition at line 19 of file SocketDescriptor.h.


Constructor & Destructor Documentation

SocketDescriptor::SocketDescriptor ( ref< FileDescriptorManager > const & _fdMgr,
int _fd ) [inline, protected]
 

Definition at line 37 of file SocketDescriptor.h.


Member Function Documentation

void SocketDescriptor::close ( ) [virtual]
 

Overridden to deal with shutdown() before close().

Reimplemented from FileDescriptor.

string const & SocketDescriptor::getLocalHostname ( ) const [inline]
 

Definition at line 63 of file SocketDescriptor.h.

int SocketDescriptor::getLocalPort ( ) const [inline]
 

Definition at line 64 of file SocketDescriptor.h.

string const & SocketDescriptor::getRemoteHostname ( ) const [inline]
 

Definition at line 65 of file SocketDescriptor.h.

int SocketDescriptor::getRemotePort ( ) const [inline]
 

Definition at line 66 of file SocketDescriptor.h.

int SocketDescriptor::lowlevel_read ( int fd,
char * buf,
int len ) [protected, virtual]
 

Override to use recv and send if on linux or win32.

Reimplemented from FileDescriptor.

virtual int SocketDescriptor::lowlevel_write ( int fd,
char const * buf,
int len ) [protected, virtual]
 

Reimplemented from FileDescriptor.

void SocketDescriptor::setLocalAddr ( string const & hostname,
int port ) [inline, protected]
 

Definition at line 45 of file SocketDescriptor.h.

void SocketDescriptor::setRemoteAddr ( string const & hostname,
int port ) [inline, protected]
 

Definition at line 50 of file SocketDescriptor.h.


Friends And Related Function Documentation

friend class ServerSocketDescriptor [friend]
 

Definition at line 36 of file SocketDescriptor.h.


Member Data Documentation

string SocketDescriptor::hostname_local [private]
 

Name of the IP-address of the local end of the socket.

Definition at line 21 of file SocketDescriptor.h.

string SocketDescriptor::hostname_remote [private]
 

Name of the IP-address of the remote end of the socket.

Definition at line 24 of file SocketDescriptor.h.

int SocketDescriptor::port_local [private]
 

Port number of the local end of the socket.

Definition at line 22 of file SocketDescriptor.h.

int SocketDescriptor::port_remote [private]
 

Port number of the remote end of the socket.

Definition at line 25 of file SocketDescriptor.h.


The documentation for this class was generated from the following file:
Generated at Wed Aug 15 01:05:32 2001 for mps-cpp by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001