cmlabs::Network Class Reference

#include <Network.h>

Inheritance diagram for cmlabs::Network:

Inheritance graph
[legend]
Collaboration diagram for cmlabs::Network:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Network (TCPReceiver *recv=NULL)
virtual ~Network ()
bool init (int portNum=-1)
void run ()
bool allowConnections (bool allow)
Objectclone () const
JString getLocalHostname ()
JString getLocalIPAddress ()
Collection getLocalIPAddresses ()
JString getRemoteHostname ()
JString getIPAddressFromName (const JString &name)
IPNumber getIPNumberFromName (const JString &name)
int getConnectionCount ()
int getSendingConnectionCount (const JString &name)
int getReceivingConnectionCount (const JString &name)
JString print ()
NetworkConnectionopenConnection (const TCPLocation &loc)
NetworkConnectionopenConnection (const TCPLocation &loc, NetProtocol *netprotocol)
NetworkConnectioncreateNetworkConnectionTo (const TCPLocation &loc, TCPReceiver *rec)
NetworkConnectionopenIncomingConnection (JSocket *sock, NetProtocol *protocol)
NetworkConnectionopenReceivingConnection (const TCPLocation &loc)
NetworkConnectionopenReceivingConnection (const TCPLocation &loc, NetProtocol *netprotocol)
bool checkReceivingConnections ()
bool checkOpenConnections ()
bool checkPrimaryConnection ()
bool setPrimaryConnection (const JString &addr, int port, const JString &name)
bool setPrimaryConnection (const TCPLocation &loc)
bool isPrimaryConnection (const JString &name)
bool tryReconnectingLostConnections ()
NetworkConnectionfindResetConnection ()
NetworkConnectionfindConnectedConnection (const TCPLocation &loc, NetProtocol *netprotocol)
NetworkConnectionfindConnectedConnection (const JString &name)
bool isCurrentlyConnectedTo (const JString &name)
bool addProtocol (NetProtocol *protocol)
bool removeProtocol (NetProtocol *protocol)
bool removeAllProtocols ()
NetProtocoldetectProtocol (JSocket *socket, long timeout)
NetProtocolgetPreferredNetProtocol ()
bool setPreferredNetProtocol (NetProtocol *prefProtocol)
bool trainNetworkProfile (const TCPLocation &loc, ConnectionProfile *profile)
bool unitTest ()
MessagereceiveTCPInput (Message *msg)
MessagenetObjectReceive (Message *msg, NetworkConnection *con)
JString getName ()
int getPort ()

Public Attributes

bool allowNetConnections
bool isInitialized
bool shouldContinue
bool isDoneRunning
TCPReceiverreceiver
NetProtocolpreferredNetProtocol
int netCheckTimeout
NetworkConnectionprimaryCon
TCPLocationprimaryLoc
ObjectDictionaryremoteReceiverCons

Protected Member Functions

void deleteConnections ()

Protected Attributes

JSocketmySocket
int port
JString localIPAddress
Collection localIPAddresses
JString localHostname
NetProtocolnetProtocols
JMutex primaryMutex
ObjectDictionary lostSendConnections
ObjectDictionary lostReceiveConnections
ObjectCollectioncons
ObjectDictionaryreceiverCons


Detailed Description

Definition at line 65 of file Network.h.


Constructor & Destructor Documentation

cmlabs::Network::Network ( TCPReceiver recv = NULL  ) 

Definition at line 35 of file Network.cpp.

cmlabs::Network::~Network (  )  [virtual]

Definition at line 57 of file Network.cpp.


Member Function Documentation

bool cmlabs::Network::init ( int  portNum = -1  ) 

Definition at line 89 of file Network.cpp.

void cmlabs::Network::run (  )  [virtual]

Reimplemented from cmlabs::JThread.

Definition at line 130 of file Network.cpp.

bool cmlabs::Network::allowConnections ( bool  allow  ) 

Definition at line 124 of file Network.cpp.

Object* cmlabs::Network::clone (  )  const [virtual]

Implements cmlabs::Object.

Definition at line 76 of file Network.h.

JString cmlabs::Network::getLocalHostname (  ) 

Definition at line 348 of file Network.cpp.

JString cmlabs::Network::getLocalIPAddress (  ) 

Definition at line 363 of file Network.cpp.

Collection cmlabs::Network::getLocalIPAddresses (  ) 

Definition at line 378 of file Network.cpp.

JString cmlabs::Network::getRemoteHostname (  ) 

Definition at line 395 of file Network.cpp.

JString cmlabs::Network::getIPAddressFromName ( const JString name  ) 

Definition at line 431 of file Network.cpp.

IPNumber cmlabs::Network::getIPNumberFromName ( const JString name  ) 

Definition at line 406 of file Network.cpp.

int cmlabs::Network::getConnectionCount (  ) 

Definition at line 1107 of file Network.cpp.

int cmlabs::Network::getSendingConnectionCount ( const JString name  ) 

Definition at line 1111 of file Network.cpp.

int cmlabs::Network::getReceivingConnectionCount ( const JString name  ) 

Definition at line 1141 of file Network.cpp.

JString cmlabs::Network::print (  )  [virtual]

Reimplemented from cmlabs::Object.

Definition at line 235 of file Network.cpp.

NetworkConnection * cmlabs::Network::openConnection ( const TCPLocation loc  ) 

Definition at line 461 of file Network.cpp.

NetworkConnection * cmlabs::Network::openConnection ( const TCPLocation loc,
NetProtocol netprotocol 
)

Definition at line 470 of file Network.cpp.

NetworkConnection * cmlabs::Network::createNetworkConnectionTo ( const TCPLocation loc,
TCPReceiver rec 
)

Definition at line 540 of file Network.cpp.

NetworkConnection * cmlabs::Network::openIncomingConnection ( JSocket sock,
NetProtocol protocol 
)

Definition at line 545 of file Network.cpp.

NetworkConnection * cmlabs::Network::openReceivingConnection ( const TCPLocation loc  ) 

Definition at line 615 of file Network.cpp.

NetworkConnection * cmlabs::Network::openReceivingConnection ( const TCPLocation loc,
NetProtocol netprotocol 
)

Definition at line 622 of file Network.cpp.

bool cmlabs::Network::checkReceivingConnections (  ) 

Definition at line 651 of file Network.cpp.

bool cmlabs::Network::checkOpenConnections (  ) 

Definition at line 699 of file Network.cpp.

bool cmlabs::Network::checkPrimaryConnection (  ) 

Definition at line 813 of file Network.cpp.

bool cmlabs::Network::setPrimaryConnection ( const JString addr,
int  port,
const JString name 
)

Definition at line 885 of file Network.cpp.

bool cmlabs::Network::setPrimaryConnection ( const TCPLocation loc  ) 

Definition at line 890 of file Network.cpp.

bool cmlabs::Network::isPrimaryConnection ( const JString name  ) 

Definition at line 925 of file Network.cpp.

bool cmlabs::Network::tryReconnectingLostConnections (  ) 

Definition at line 773 of file Network.cpp.

NetworkConnection * cmlabs::Network::findResetConnection (  ) 

Definition at line 1018 of file Network.cpp.

NetworkConnection * cmlabs::Network::findConnectedConnection ( const TCPLocation loc,
NetProtocol netprotocol 
)

Definition at line 996 of file Network.cpp.

NetworkConnection * cmlabs::Network::findConnectedConnection ( const JString name  ) 

Definition at line 957 of file Network.cpp.

bool cmlabs::Network::isCurrentlyConnectedTo ( const JString name  ) 

Definition at line 934 of file Network.cpp.

bool cmlabs::Network::addProtocol ( NetProtocol protocol  ) 

Definition at line 250 of file Network.cpp.

bool cmlabs::Network::removeProtocol ( NetProtocol protocol  ) 

Definition at line 266 of file Network.cpp.

bool cmlabs::Network::removeAllProtocols (  ) 

Definition at line 290 of file Network.cpp.

NetProtocol * cmlabs::Network::detectProtocol ( JSocket socket,
long  timeout 
)

Definition at line 302 of file Network.cpp.

NetProtocol * cmlabs::Network::getPreferredNetProtocol (  ) 

Definition at line 450 of file Network.cpp.

bool cmlabs::Network::setPreferredNetProtocol ( NetProtocol prefProtocol  ) 

Definition at line 454 of file Network.cpp.

bool cmlabs::Network::trainNetworkProfile ( const TCPLocation loc,
ConnectionProfile profile 
)

Definition at line 1171 of file Network.cpp.

bool cmlabs::Network::unitTest (  ) 

Reimplemented from cmlabs::JThread.

Definition at line 1199 of file Network.cpp.

Message * cmlabs::Network::receiveTCPInput ( Message msg  ) 

Definition at line 1038 of file Network.cpp.

Message * cmlabs::Network::netObjectReceive ( Message msg,
NetworkConnection con 
) [virtual]

Reimplemented from cmlabs::TCPReceiver.

Definition at line 1043 of file Network.cpp.

JString cmlabs::Network::getName (  )  [virtual]

Implements cmlabs::TCPReceiver.

Definition at line 1099 of file Network.cpp.

int cmlabs::Network::getPort (  ) 

Definition at line 1103 of file Network.cpp.

void cmlabs::Network::deleteConnections (  )  [protected]

Definition at line 205 of file Network.cpp.


Member Data Documentation

Definition at line 74 of file Network.h.

Definition at line 77 of file Network.h.

Definition at line 78 of file Network.h.

Definition at line 79 of file Network.h.

Definition at line 128 of file Network.h.

Definition at line 129 of file Network.h.

Definition at line 130 of file Network.h.

Definition at line 131 of file Network.h.

Definition at line 132 of file Network.h.

Definition at line 134 of file Network.h.

Definition at line 138 of file Network.h.

int cmlabs::Network::port [protected]

Definition at line 139 of file Network.h.

Definition at line 140 of file Network.h.

Definition at line 141 of file Network.h.

Definition at line 142 of file Network.h.

Definition at line 144 of file Network.h.

Definition at line 145 of file Network.h.

Definition at line 147 of file Network.h.

Definition at line 148 of file Network.h.

Definition at line 150 of file Network.h.

Definition at line 151 of file Network.h.


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

Generated on Tue Jul 7 16:23:32 2009 for CoreLibrary by  doxygen 1.5.6