The C++ framework for developing highly scalable, high performance servers on Windows platforms.

IPoolableSocket Class Reference
[SocketsInterfacesOpaque user data]

Inheritance diagram for IPoolableSocket:
Collaboration diagram for IPoolableSocket:

List of all members.


Detailed Description

The IPoolableSocket interface provides the 'poolability' of the sockets. Poolable sockets are pooled using a CNodeList and so, for a socket to be pooled it must derive from CNodeList::Node. When a socket is used from the pool or released to the pool the allocator passes the socket's user data to the allocation monitor and so poolable sockets must support IIndexedOpaqueUserData.

Public Types

typedef unsigned short UserDataIndex

Public Member Functions

virtual ~IPoolableSocket ()
 Instances of this interface can be deleted by their users.
virtual void Attach (IPoolableSocketManager &manager, ISocketCallback &callback, SOCKET socket)=0
 Attach the supplied socket manager interface, callback inteface and SOCKET to the pooled socket.
virtual bool AbortConnectionIfManagedBy (const IPoolableSocketManager &manager, ConnectionClosureReason reason)=0
 Close if the manager that is attached to this socket is the same as the one supplied.
virtual void DumpIfManagedBy (const IPoolableSocketManager &manager) const =0
virtual bool AddRefIfPossible ()=0
 Attempt to obtain a reference from a socket that we currently don't own a reference to. This checks that the socket isn't currently in the middle of being destroyed and returns true if you now own a valid reference to the socket. Remember to call Release() on the socket if this function returns true.
virtual void Release ()=0
 Release a reference to the socket.
virtual void * GetUserPointer (UserDataIndex index) const =0
 Access the data stored at the specified index as a void pointer.
virtual void SetUserPointer (UserDataIndex index, void *pData)=0
 Update the data stored at the specified index as a void pointer.
virtual ULONG_PTR GetUserData (UserDataIndex index) const =0
 Access the data stored at the specified index as an unsigned long.
virtual void SetUserData (UserDataIndex index, ULONG_PTR data)=0
 Update the data stored at the specified index as an unsigned long.
Node * Next () const
 Return the next node in the list.
void Next (Node *pNext)
 Set the given node to be this nodes 'next node'.
void RemoveFromList ()
 If this node is currently in a list then it is removed.
bool InList (const CNodeList &list) const
 Returns true if this node is currently in the specified list.
bool InList () const
 Returns true if this node is currently in any list.

Static Public Attributes

static
JETBYTE_CONSTEXPR
UserDataIndex 
InvalidUserDataIndex = 0xFFFF

Member Typedef Documentation


Constructor & Destructor Documentation

virtual ~IPoolableSocket (  )  [virtual]

Instances of this interface can be deleted by their users.


Member Function Documentation

CNodeList::Node * Next (  )  const [inherited]

Return the next node in the list.

void Next ( Node pNext  )  [inherited]

Set the given node to be this nodes 'next node'.

void RemoveFromList (  )  [inherited]

If this node is currently in a list then it is removed.

bool InList ( const CNodeList list  )  const [inherited]

Returns true if this node is currently in the specified list.

bool InList (  )  const [inherited]

Returns true if this node is currently in any list.


Member Data Documentation

JETBYTE_CONSTEXPR UserDataIndex InvalidUserDataIndex = 0xFFFF [static, inherited]


Generated on Sun Sep 12 19:10:26 2021 for The Server Framework - v7.4 by doxygen 1.5.3