Overall Design

Overview of the Design
Acceptor Connector environment is an object oriented framework that implements active and passive connection establishment patterns for communication software.This includes several components that help in development of software which is flexible and efficient. This consists of a layered form of design as given below
1.Acceptor ,Connector and service Handler which forms framework for developing Utilities .
2.C++ Wrapper classes which are base classes for the above patterns. They encapsulate the below layer.
3. The C API which consists of system calls for network programming.

SOCK.jpg - 92058 Bytes

Framework Components :

Acceptor : The Acceptor pattern has been designed to decouple connection establishment from the service which is performed after the connection has been established.Connection establishment may be secondary significance which can be done through BSD socket interface.An acceptor is usually used where we imagine the use of BSD accept() system call.The acceptor pattern is implemented with the help of concrete-acceptor which is basically a class.It provides the same interface to the applications using this class.It is implemented as a template container ,which is instantiated with two classes as its actual parameters. template {class SVC_HANDLER,class SVC_ADDR}

ACCEP.jpg - 63766 Bytes

Connector :
The connector pattern is similar to the acceptor but it is used to actively connect to remote host.Once connectin is established ,it will automatically call back open() method .An connector is usually used where we imagine the use of BSD connect() system call.The connector pattern is implemented with the help of concrete-connecttor which is basically a class.It provides the same interface to the applications using this class.It is implemented as a template container ,which is instantiated with two classes as its actual parameters. template

CONNEC.jpg - 67490 Bytes


Service Handler : The object of this class has the ability to react to events and to send and receive data between remote tasks on remote hosts.It is implemented as a template container template this template is instantiated to create the desired service handler by passing the underlying stream and address.




Using Acceptor and Connector together :
The acceptor and connector patterns will in general ,be used together.In client-Server server will typically contain the acceptor and client contains connector.The user can take arguments and can tell the application whether it is going to play a server or client role.



How the Connector Acceptor pattern work :
Both the acceptor annd connector have a similar operational structure.Their workings can be roughly divided into three stages
Endpoint initialization phase
Service initializatin phase
Service processing phase.



ACCP.jpg - 65764 Bytes


In case of acceptor ,the application level programmer may call open() method of class and start passively to listen to connections which then calls concrerte acceptors open() method.The concrete acceptor will then do necessary initialisation it needs to listen for incoming connections.
CONN.jpg - 48396 Bytes


In case of connector the application programmer will call the connect() method to initiate a connection to the peer.Both these methods see whether the connection is synchronous or asynchronous.


Back to main Page