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

MynahSA::TCPConnectionManager Class Reference

#include <tcpconnectionmanager.hpp>

Collaboration diagram for MynahSA::TCPConnectionManager:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TCPConnectionManager (RequestResponseHandler &handler, const StreamConstructor &cons)
 ~TCPConnectionManager ()
void operator() (int fd)

Detailed Description

class TCPConnectionManager - This class is designed to manage an individual TCP connection.

Design: TCPServer manages ALL incoming connections. When an incomming connection is requested the TCPServer spawns a thread to manage all I/O over that particular TCP connection. The class responsible for handling the connection is TCPConnectionManager. TCPConnectionManager performs some basic stream initialization, then proceeds to stream objects off of the stream and reconstruct them in memory. Once the in-memory image is ready, the request/response handler is invoked to transform an object received off of the stream into a response. The response is then placed back onto the stream for the client to process.

Notes: TCPConnection manager and descendant classes must be thread safe. StreamType must support copy construction.

Definition at line 43 of file tcpconnectionmanager.hpp.


Constructor & Destructor Documentation

MynahSA::TCPConnectionManager::TCPConnectionManager RequestResponseHandler handler,
const StreamConstructor cons
 

Constructor

Parameters:
handler - Object Handler - embeds the behavior of the server in this functional object
cons - constructor - provides constructor objects for the ITCPArchive, allowing it to recover objects off of the stream.
Returns:
- Nothing

MynahSA::TCPConnectionManager::~TCPConnectionManager  ) 
 

Destructor

Returns:
Nothing


Member Function Documentation

void MynahSA::TCPConnectionManager::operator() int  fd  ) 
 

operator() - takes file descriptor fd and performs TCP i/o on it.

Parameters:
fd - File Descriptor to network port attached to tcp client


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