SocketBase Class Reference

#include <sockets.h>

Inheritance diagram for SocketBase:

Inheritance graph
[legend]
List of all members.

Detailed Description

Base class for Socket classes, all members are protected and destructor is pure virtual - don't use this class directly.

Definition at line 82 of file sockets.h.


Public Types

typedef SocketEvent EventType
typedef SocketClient AcceptType
typedef SocketPriority PriorityType
enum  SocketPriority { PR_LOW = -1, PR_NORMAL = 0, PR_HIGH = 1 }
 Socket prioritites. More...

Public Member Functions

SOCKET getSocket ()
 Retrieve the internal SOCKET object.
bool toDelete () const
 If this socket is marked for deletion.
void setPriority (SocketPriority prio)
 Set the priority of this socket.
int8_t getPriority () const
 Get the priority of this socket.

Protected Member Functions

 SocketBase ()
 Base constructor.
 SocketBase (SOCKET s)
 Construct from existing socket.
virtual ~SocketBase ()=0
 Pure virtual destructor.
virtual void destroy ()=0
 Derived classes must implement this method.

Protected Attributes

SOCKET m_socket
 Internal socket object.
bool m_toDelete
 Initialized to false and set to true in destroy() method in derived classes, this indicates SocketWatcher must delete the object during removal.
int8_t m_priority
 Socket's priority.

Member Typedef Documentation

typedef SocketClient SocketBase::AcceptType
 

Definition at line 92 of file sockets.h.

typedef SocketEvent SocketBase::EventType
 

Definition at line 91 of file sockets.h.

typedef SocketPriority SocketBase::PriorityType
 

Definition at line 93 of file sockets.h.


Member Enumeration Documentation

enum SocketBase::SocketPriority
 

Socket prioritites.

Enumeration values:
PR_LOW 
PR_NORMAL 
PR_HIGH 

Definition at line 85 of file sockets.h.


Constructor & Destructor Documentation

SocketBase::SocketBase  )  [protected]
 

Base constructor.

Definition at line 203 of file sockets.cpp.

SocketBase::SocketBase SOCKET  s  )  [protected]
 

Construct from existing socket.

Definition at line 205 of file sockets.cpp.

SocketBase::~SocketBase  )  [protected, pure virtual]
 

Pure virtual destructor.

Definition at line 207 of file sockets.cpp.


Member Function Documentation

virtual void SocketBase::destroy  )  [protected, pure virtual]
 

Derived classes must implement this method.

Implemented in SocketClient, SocketServer, and UDPSocket.

int8_t SocketBase::getPriority  )  const [inline]
 

Get the priority of this socket.

Definition at line 115 of file sockets.h.

SOCKET SocketBase::getSocket  )  [inline]
 

Retrieve the internal SOCKET object.

Definition at line 98 of file sockets.h.

Referenced by SocketWatcher::cleanupSockets().

void SocketBase::setPriority SocketPriority  prio  )  [inline]
 

Set the priority of this socket.

This affects it's scheduling policy, higher-priority get handled before lower-priority sockets.

Parameters:
prio Priority

Definition at line 110 of file sockets.h.

bool SocketBase::toDelete  )  const [inline]
 

If this socket is marked for deletion.

Definition at line 101 of file sockets.h.

Referenced by SocketWatcher::cleanupSockets().


Member Data Documentation

int8_t SocketBase::m_priority [protected]
 

Socket's priority.

Definition at line 145 of file sockets.h.

SOCKET SocketBase::m_socket [protected]
 

Internal socket object.

Definition at line 137 of file sockets.h.

Referenced by SocketServer::accept().

bool SocketBase::m_toDelete [protected]
 

Initialized to false and set to true in destroy() method in derived classes, this indicates SocketWatcher must delete the object during removal.

Definition at line 142 of file sockets.h.


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