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

SST::Socket Class Reference

Abstract base class representing network attachments for the SST protocols to use. More...

#include <sock.h>

Inheritance diagram for SST::Socket:

SST::UdpSocket List of all members.

Public Member Functions

 Socket (SocketHostState *host, QObject *parent=NULL)
bool active ()
 Determine whether this socket is active.

void setActive (bool act)
 Activate or deactivate this Socket.

virtual bool bind (const QHostAddress &addr=QHostAddress::Any, quint16 port=0, QUdpSocket::BindMode mode=QUdpSocket::DefaultForPlatform)=0
 Bind this socket to a local port and activate it if successful.

virtual bool send (const Endpoint &ep, const char *data, int size)=0
 Send a packet on this socket.

bool send (const Endpoint &ep, const QByteArray &msg)
virtual QList< Endpoint > localEndpoints ()=0
 Find all known local endpoints referring to this socket.

virtual quint16 localPort ()=0
SocketFlow * flow (const Endpoint &dst, Channel chan)
 Find flow associations attached to this socket.

virtual QString errorString ()=0
 Return a description of any error detected on bind() or send().


Protected Member Functions

void receive (QByteArray &msg, const SocketEndpoint &src)
 Implementation subclass calls this method with received packets.


Friends

class SocketFlow

Detailed Description

Abstract base class representing network attachments for the SST protocols to use.

See also:
UdpSocket


Member Function Documentation

bool SST::Socket::active  )  [inline]
 

Determine whether this socket is active.

Only active sockets are returned by SocketHostState::activeSockets().

Returns:
true if socket is active.

virtual bool SST::Socket::bind const QHostAddress &  addr = QHostAddress::Any,
quint16  port = 0,
QUdpSocket::BindMode  mode = QUdpSocket::DefaultForPlatform
[pure virtual]
 

Bind this socket to a local port and activate it if successful.

Parameters:
addr the address to bind to, normally QHostAddress::Any.
port the port to bind to, 0 for any port.
mode how to bind the socket - see QUdpSocket::BindMode.

Implemented in SST::UdpSocket.

virtual QList<Endpoint> SST::Socket::localEndpoints  )  [pure virtual]
 

Find all known local endpoints referring to this socket.

Returns:
a list of Endpoint objects.

Implemented in SST::UdpSocket.

void Socket::receive QByteArray &  msg,
const SocketEndpoint &  src
[protected]
 

Implementation subclass calls this method with received packets.

Parameters:
msg the packet received
src the source from which the packet arrived

virtual bool SST::Socket::send const Endpoint &  ep,
const char *  data,
int  size
[pure virtual]
 

Send a packet on this socket.

Parameters:
ep the destination address to send the packet to
msg the packet data
Returns:
true if send was successful

Implemented in SST::UdpSocket.

void Socket::setActive bool  act  ) 
 

Activate or deactivate this Socket.

Only active sockets are returned from calls to activeSockets().

Parameters:
act true if the socket should be marked active.


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