# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NLNET::CServerBufSock Class Reference

CServerBufSock A socket, its send buffer plus a nonblocking receiving system. More...

#include <buf_sock.h>

Inheritance diagram for NLNET::CServerBufSock:

NLNET::CBufSock List of all members.

Protected Methods

 CServerBufSock (CTcpSock *sock)
 Constructor with an existing socket (created by an accept()). More...

void setOwnerTask (CServerReceiveTask *owner)
 Sets the task that "owns" the CServerBufSock object. More...

CServerReceiveTaskownerTask ()
 Returns the task that "owns" the CServerBufSock object. More...

bool receivePart ()
 Receives a part of a message (nonblocking socket only). More...

const std::vector< uint8receivedBuffer () const
 Returns the filled buffer (call after receivePart() returns true). More...

bool advertiseConnection (CBufServer *bnb)
 Pushes a connection message into bnb's receive queue, if it has not already been done (returns true in this case). More...

virtual std::string typeStr () const
 Returns "SRV " (server). More...


Private Attributes

bool _Advertised
 True after a connection callback has been sent to the user, for this connection. More...

bool _NowReadingBuffer
TBlockSize _BytesRead
TBlockSize _Length
std::vector< uint8_ReceiveBuffer
CServerReceiveTask_OwnerTask

Friends

class CBufServer
class CListenTask
class CServerReceiveTask

Detailed Description

CServerBufSock A socket, its send buffer plus a nonblocking receiving system.

Definition at line 276 of file buf_sock.h.


Constructor & Destructor Documentation

NLNET::CServerBufSock::CServerBufSock CTcpSock   sock [protected]
 

Constructor with an existing socket (created by an accept()).

Don't forget to call setOwnerTask().

Definition at line 351 of file buf_sock.cpp.

References nlassert, and nlnettrace.


Member Function Documentation

bool NLNET::CServerBufSock::advertiseConnection CBufServer   bnb [inline, protected]
 

Pushes a connection message into bnb's receive queue, if it has not already been done (returns true in this case).

Definition at line 306 of file buf_sock.h.

References NLNET::CBufSock::_KnowConnected, NLNET::CBufSock::advertiseSystemEvent, and CBufServer.

CServerReceiveTask* NLNET::CServerBufSock::ownerTask   [inline, protected]
 

Returns the task that "owns" the CServerBufSock object.

Definition at line 293 of file buf_sock.h.

References _OwnerTask, and CServerReceiveTask.

const std::vector<uint8> NLNET::CServerBufSock::receivedBuffer   const [inline, protected]
 

Returns the filled buffer (call after receivePart() returns true).

Definition at line 301 of file buf_sock.h.

References _ReceiveBuffer, and nlnettrace.

bool NLNET::CServerBufSock::receivePart   [protected]
 

Receives a part of a message (nonblocking socket only).

Returns:
True if the message has been completely received

Definition at line 370 of file buf_sock.cpp.

References _BytesRead, _Length, _NowReadingBuffer, _OwnerTask, _ReceiveBuffer, NLNET::CBufSock::asString, nlassert, nldebug, nlnettrace, nlwarning, NLNET::CBufSock::Sock, and NLNET::TBlockSize.

void NLNET::CServerBufSock::setOwnerTask CServerReceiveTask   owner [inline, protected]
 

Sets the task that "owns" the CServerBufSock object.

Definition at line 290 of file buf_sock.h.

References _OwnerTask, and CServerReceiveTask.

virtual std::string NLNET::CServerBufSock::typeStr   const [inline, protected, virtual]
 

Returns "SRV " (server).

Reimplemented from NLNET::CBufSock.

Definition at line 312 of file buf_sock.h.


Friends And Related Function Documentation

friend class CBufServer [friend]
 

Reimplemented from NLNET::CBufSock.

Definition at line 280 of file buf_sock.h.

Referenced by advertiseConnection.

friend class CListenTask [friend]
 

Definition at line 281 of file buf_sock.h.

friend class CServerReceiveTask [friend]
 

Reimplemented from NLNET::CBufSock.

Definition at line 282 of file buf_sock.h.

Referenced by ownerTask, and setOwnerTask.


Member Data Documentation

bool NLNET::CServerBufSock::_Advertised [private]
 

True after a connection callback has been sent to the user, for this connection.

Definition at line 317 of file buf_sock.h.

TBlockSize NLNET::CServerBufSock::_BytesRead [private]
 

Definition at line 323 of file buf_sock.h.

Referenced by receivePart.

TBlockSize NLNET::CServerBufSock::_Length [private]
 

Definition at line 326 of file buf_sock.h.

Referenced by receivePart.

bool NLNET::CServerBufSock::_NowReadingBuffer [private]
 

Definition at line 320 of file buf_sock.h.

Referenced by receivePart.

CServerReceiveTask* NLNET::CServerBufSock::_OwnerTask [private]
 

Definition at line 332 of file buf_sock.h.

Referenced by ownerTask, receivePart, and setOwnerTask.

std::vector<uint8> NLNET::CServerBufSock::_ReceiveBuffer [private]
 

Definition at line 329 of file buf_sock.h.

Referenced by receivedBuffer, and receivePart.


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