Contents User Forum Source Index APIs by Task APIs by Level Data


G3D::NetworkDevice Class Reference

An abstraction over sockets that provides a message based network infrastructure optimized for sending many small (>500 byte) messages. More...

#include <NetworkDevice.h>

List of all members.

Public Member Functions

void describeSystem (std::string &s)
void describeSystem (TextOutput &t)
void localHostAddresses (Array< NetAddress > &array) const
std::string localHostName () const
 ~NetworkDevice ()

Static Public Member Functions

static void cleanup ()
static NetworkDeviceinstance ()

Friends

class Conduit
class LightweightConduit
class NetListener
class ReliableConduit


Detailed Description

An abstraction over sockets that provides a message based network infrastructure optimized for sending many small (>500 byte) messages.

All functions always return immediately.

Create only one NetworkDevice per-process (WinSock restriction).

NetworkDevice is technically not thread safe. However, as long as you use different conduits on different threads (or lock conduits before sending), you will encounter no problems sharing the single NetworkDevice across multiple threads. That is, do not invoke a Conduit's send or receive method on two threads at once.

This assumes that the underlying WinSock/BSD sockets implementation is thread safe. That is not guaranteed, but in practice seems to always be true (e.g. http://tangentsoft.net/wskfaq/intermediate.html#threadsafety)


Constructor & Destructor Documentation

G3D::NetworkDevice::~NetworkDevice (  ) 


Member Function Documentation

static void G3D::NetworkDevice::cleanup (  )  [static]

Shuts down the network device (destroying the global instance).

void G3D::NetworkDevice::describeSystem ( std::string &  s  ) 

void G3D::NetworkDevice::describeSystem ( TextOutput t  ) 

Prints a human-readable description of this machine to the text output stream.

Either argument may be NULL.

static NetworkDevice* G3D::NetworkDevice::instance (  )  [static]

Returns NULL if there was a problem initializing the network.

void G3D::NetworkDevice::localHostAddresses ( Array< NetAddress > &  array  )  const

There is often more than one address for the local host.

This returns all of them.

std::string G3D::NetworkDevice::localHostName (  )  const

Returns the name of this computer.


Friends And Related Function Documentation

friend class Conduit [friend]

friend class LightweightConduit [friend]

friend class NetListener [friend]

friend class ReliableConduit [friend]


The documentation for this class was generated from the following file:
Generated on Thu Aug 2 11:40:47 2007 for G3D by doxygen 1.5.2
Hosted by SourceForge.net Logo