Main Page | Class Hierarchy | Class List | File List | Class Members

SST::SocketHostState Class Reference

Per-host state for the Socket module. More...

#include <sock.h>

Inheritance diagram for SST::SocketHostState:

SST::Host List of all members.

Public Member Functions

QList< Socket * > activeSockets ()
 Obtain a list of all currently active sockets.

QList< Endpoint > activeLocalEndpoints ()
 Get a list of all known local endpoints for all active sockets.

SocketReceiver * lookupReceiver (quint32 magic)
virtual SocketnewSocket (QObject *parent=NULL)
 Create a new network Socket.

SocketinitSocket (QSettings *settings=NULL, int defaultport=NETSTERIA_DEFAULT_PORT)
 Create and get at least one Socket up and running.


Friends

class Socket
class SocketReceiver

Detailed Description

Per-host state for the Socket module.

This class encapsulates all the state for this module that would normally be held in global/static variables.

See also:
Host


Member Function Documentation

QList<Socket*> SST::SocketHostState::activeSockets  )  [inline]
 

Obtain a list of all currently active sockets.

Used by upper-level protocols (e.g., key exchange, registration) to send out initial discovery messages on all available sockets. Subsequent messages normally get sent only to the specific socket a discovery response was seen on.

Returns:
a list of pointers to each currently active Socket.

Socket * SocketHostState::initSocket QSettings *  settings = NULL,
int  defaultport = NETSTERIA_DEFAULT_PORT
 

Create and get at least one Socket up and running.

This function only creates one socket no matter how many times it is called. It exits the application via qFatal() if socket creation fails.

Parameters:
host the Host instance the socket should be attached to.
settings if non-NULL, init() looks for a 'port' tag and uses it in place of the specified default port if found. In any case, sets the 'port' tag to the port actually used.
defaultport the default port to bind to if no 'port' tag is found in the settings.
Returns:
the Socket created (during this or a previous call).

Socket * SocketHostState::newSocket QObject *  parent = NULL  )  [virtual]
 

Create a new network Socket.

The default implementation creates a UdpSocket, but this may be overridden to virtualize the network.


The documentation for this class was generated from the following files:
Generated on Wed Mar 28 11:48:05 2007 for SST by doxygen 1.3.4