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

MPS::InetTransport Class Reference

Implements a TCP/IP-socket Transport class for accessing and serving MPS objects. More...

#include <transport_inet.h>

Inheritance diagram for MPS::InetTransport:

Inheritance graph
[legend]
Collaboration diagram for MPS::InetTransport:

Collaboration graph
[legend]
List of all members.

Static Public Methods

void initialise (string const &hostName, int portNumber)
ref<FileDescriptorManager>
const& 
getFdMgr ()

Protected Methods

virtual ref<ConnectionconnectTo (Address const &connectionSpec)
virtual string registerServer (Server *server, Address const &spec)
virtual string deregisterServer (Server *server, Address const &spec)
ref<FileDescriptorsocketFor (Address const &connectionSpec)

Private Types

typedef map< string, ref<InetDemux> > demuxMap_t

Private Methods

 InetTransport (string const &hostName, int portNumber)
ref<InetDemuxregisterServerSocket (ref< ServerSocketDescriptor > const &serverSock)

Private Attributes

ref<FileDescriptorManagerfdMgr
demuxMap_t clientMap
demuxMap_t serverMap
ref<InetDemuxdefaultDemux
int nextOid

Static Private Attributes

InetTransport* instance

Detailed Description

Implements a TCP/IP-socket Transport class for accessing and serving MPS objects.

Manages all server and client sockets for this process. Dispatches incoming work to the appropriate objects.

Definition at line 49 of file transport_inet.h.


Member Typedef Documentation

typedef map< string, ref< InetDemux > > MPS::InetTransport::demuxMap_t< string, ref<InetDemux> > [private]
 

Map of inet addr -> demux.

Definition at line 60 of file transport_inet.h.


Constructor & Destructor Documentation

MPS::InetTransport::InetTransport ( string const & hostName,
int portNumber ) [private]
 

Referenced by initialise().


Member Function Documentation

virtual ref<Connection> MPS::InetTransport::connectTo ( Address const & connectionSpec ) [protected, virtual]
 

Returns a message source/sink that can be used for communication with the object at the address described by the connectionSpec.

The connectionSpec is the broken-down resolved name of the remote object, and must match the address format that this transport expects.

Parameters:
connectionSpec   the address of the remote object
Returns:
a connection handle for remote communication, or NULL if none could be created

Reimplemented from MPS::Transport.

virtual string MPS::InetTransport::deregisterServer ( Server * server,
Address const & spec ) [protected, virtual]
 

Attempt to deregister a server interface.

Parameters:
server   the server to deregister
spec   the connection specification that the transport may use as a hint in determining the final resolved name to use when unbinding this object.
Returns:
the canonical name of the server-that-was-bound-to-this-transport, or "" if unbinding from this transport fails.

Reimplemented from MPS::Transport.

ref<FileDescriptorManager> const& MPS::InetTransport::getFdMgr ( ) [inline, static]
 

Once you have access to the FileDescriptorManager, you can call the mainloop(), processFdSet() or poll() methods on it to service requests managed by this Transport.

Definition at line 105 of file transport_inet.h.

Referenced by main().

void MPS::InetTransport::initialise ( string const & hostName,
int portNumber ) [inline, static]
 

Creates the single per-application instance of InetTransport, and registers it using Transport::registerTransport().

Parameters:
namingServerLocation   resolved address of the naming server to use
hostName   either "" (for all) or the name of the local interface to bind to
portNumber   either 0 (for any) or the number of the TCP port to bind to

Definition at line 93 of file transport_inet.h.

Referenced by main().

virtual string MPS::InetTransport::registerServer ( Server * server,
Address const & spec ) [protected, virtual]
 

Attempt to register a server interface for access using this transport.

Parameters:
server   the server to register
spec   the connection specification that the transport may use as a hint in determining the final resolved name to use when binding this object.
Returns:
the canonical name of the server-bound-to-this-transport, or "" if binding to this transport fails.

Reimplemented from MPS::Transport.

ref<InetDemux> MPS::InetTransport::registerServerSocket ( ref< ServerSocketDescriptor > const & serverSock ) [private]
 

ref<FileDescriptor> MPS::InetTransport::socketFor ( Address const & connectionSpec ) [protected]
 


Member Data Documentation

demuxMap_t MPS::InetTransport::clientMap [private]
 

Find a client demux for a given ipaddr:port.

Definition at line 66 of file transport_inet.h.

ref< InetDemux > MPS::InetTransport::defaultDemux<InetDemux> [private]
 

Demultiplexor for the server socket.

Definition at line 68 of file transport_inet.h.

ref< FileDescriptorManager > MPS::InetTransport::fdMgr<FileDescriptorManager> [private]
 

All FileDescriptors we are responsible for.

Definition at line 64 of file transport_inet.h.

InetTransport* MPS::InetTransport::instance [static, private]
 

The single, per-application instance of InetTransport.

Definition at line 51 of file transport_inet.h.

int MPS::InetTransport::nextOid [private]
 

Next OID available for registration here.

Definition at line 69 of file transport_inet.h.

demuxMap_t MPS::InetTransport::serverMap [private]
 

Find a server demux for a given ipaddr:port.

Definition at line 67 of file transport_inet.h.


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