Main Page | Modules | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

NetCommPortal Class Reference
[Communications Facilities]

#include <NetCommPortal.hh>

Inherits FileCommPortal.

List of all members.


Detailed Description

Concrete class for a network messaging.

The concrete subclass of CommPortal which manages UDP based communications. It manages a UDP socket that messages can be received from and sent to. It is designed to be able to be used in conjunction with multiple NetRemoteManagers, as there can be multiple destinations sending through the same UDP socket.


Public Member Functions

virtual ~NetCommPortal ()
bool init (CommManager *mgr, int port)
virtual MessagereceiveMsg ()
virtual bool releaseMsg (Message *message)
virtual bool flush ()
NetRemoteManageropenRemote (const char *machine, int port)

Static Public Member Functions

NetCommPortalinstance (utils::SymbolTable *table)


Constructor & Destructor Documentation

virtual NetCommPortal::~NetCommPortal  )  [virtual]
 

This will close the UDP socket


Member Function Documentation

virtual bool NetCommPortal::flush  )  [virtual]
 

Flush message sends. If we are packaging or buffering message sends, force the real sends.

Returns:
Returns true for success and false for failure

Implements CommPortal.

bool NetCommPortal::init CommManager mgr,
int  port
 

Initialize the messager. Connect it to a CommManager and select a UDP port. A side effect is the storage of the portal in the manager's symbol table under the name NET_COMM_PORTAL_INSTANCE

Parameters:
[in] mgr The controller communications manager.
[in] port The UDP port to setup on.
Returns:
true for success, false for fatal failure

Reimplemented from FileCommPortal.

NetCommPortal* NetCommPortal::instance utils::SymbolTable *  table  )  [static]
 

Returns the communications protocol instance from manager. It looks up the symbol in the manager's symbol table under NET_COMM_PORTAL_INSTANCE

NetRemoteManager* NetCommPortal::openRemote const char *  machine,
int  port
 

Open a remote manager via the net, or return it if it is already open.

Parameters:
[in] machine The remote machine name
[in] port The remote port
Returns:
Either the created or looked up remote manager, or NULL for error

virtual Message* NetCommPortal::receiveMsg  )  [virtual]
 

Receive a message, blocking until one is available.

Returns:
Returns NULL for failure, and the next available message on success

Implements CommPortal.

virtual bool NetCommPortal::releaseMsg Message message  )  [virtual]
 

Release a message received by CommPortal::receiveMsg. If you do not do this when you are done with a message, there will be a memory leak.

Parameters:
[in] message The message to be released.
Returns:
Return true for success and false for failure.

Implements CommPortal.


RHexLib Reference Documentation