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

MNTCPSocket Class Reference

#include <MNTCPSocket.h>

Inheritance diagram for MNTCPSocket:

Inheritance graph
[legend]
Collaboration diagram for MNTCPSocket:

Collaboration graph
[legend]
List of all members.

Public Types

enum  CreationMode { MakeNow }
enum  Fail { Ok = 0, Errno = -1, Herrno = -2 }

Public Member Functions

 MNTCPSocket ()
 MNTCPSocket (int i)
 MNTCPSocket (int i, CreationMode mode)
virtual ~MNTCPSocket ()
void warn_errors (int errval)
virtual void callback (MNSelector *select, int fd)=0
virtual void tcallback ()
virtual bool isUdp () const
virtual Fail connect (int port, const char *hostname)
virtual Fail connect (const struct sockaddr_in &dest)
int read (char *buffer, int len)
int write (const char *buf, int len)
bool getLocalSockAddr (struct sockaddr_in &addr)
bool getRemoteSockAddr (struct sockaddr_in &addr)

Protected Member Functions

void show_buffers (struct iovec *iov)

Member Enumeration Documentation

enum MNTCPSocket::CreationMode
 

Enumeration values:
MakeNow 

enum MNTCPSocket::Fail
 

Enumeration values:
Ok 
Errno 
Herrno 


Constructor & Destructor Documentation

MNTCPSocket::MNTCPSocket  ) 
 

MNTCPSocket::MNTCPSocket int  i  ) 
 

MNTCPSocket::MNTCPSocket int  i,
CreationMode  mode
 

virtual MNTCPSocket::~MNTCPSocket  )  [virtual]
 


Member Function Documentation

virtual void MNTCPSocket::callback MNSelector select,
int  fd
[pure virtual]
 

Reimplemented from MNSocketBase.

Implemented in MNTCPServerSocket, MNTCPClientSocket, RTPServerSocket, and RTSPFillBuffer.

virtual Fail MNTCPSocket::connect const struct sockaddr_in &  dest  )  [virtual]
 

Calls transparently the ::connect function. It has been virtualized to provide subclasses the possibility for post-processing, e.g. changing the socket to non-blocking after a successful connect.

virtual Fail MNTCPSocket::connect int  port,
const char *  hostname
[virtual]
 

Calls transparently the ::connect function. It has been virtualized to provide subclasses the possibility for post-processing, e.g. changing the socket to non-blocking after a successful connect.

Reimplemented in RTSPFillBuffer.

bool MNTCPSocket::getLocalSockAddr struct sockaddr_in &  addr  ) 
 

A host with multiple interfaces and INADDR_ANY in the sockaddr_in structure during connect will choose the most appropriate IP address to connect to that host. It is very likely that this address is also the best address to send to the server for connection establishment in the opposite direction. Therefore, this functions makes it possible to ask for this address. It is only valid when the socket is connected.

Parameters:
addr An OUT parameter that is supposed to hold the address information for the connected local socket.
Returns:
True is the address structure has been filled in successfully, false otherwise.

bool MNTCPSocket::getRemoteSockAddr struct sockaddr_in &  addr  ) 
 

It may be interesting to connect to the same remote interface. If this socket is already connected, you can use this function to get the appropriate structure filled.

Parameters:
addr An OUT parameter that will contain the address information of the peer on return, if the return value is true.
Returns:
True is the address structure has been filled in successfully, false otherwise.

virtual bool MNTCPSocket::isUdp  )  const [inline, virtual]
 

Simple function returning false. It is used to figure out what kind of socket is used. This is a TCP class so the function returns false.

Returns:
Always false since this is a TCP socket class.

Implements MNSocket.

int MNTCPSocket::read char *  buffer,
int  len
 

The read call is mapped to the operating system call recv(). The output of recv() is not modified. If the return value is negative, errno holds the details.

void MNTCPSocket::show_buffers struct iovec *  iov  )  [protected]
 

virtual void MNTCPSocket::tcallback  )  [inline, virtual]
 

void MNTCPSocket::warn_errors int  errval  ) 
 

int MNTCPSocket::write const char *  buf,
int  len
 


The documentation for this class was generated from the following file:
Generated on Sun Mar 6 13:36:03 2005 for Komssys by doxygen 1.3.8