|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NLNET::CBufClient Class ReferenceClient class for layer 1.
More...
#include <buf_client.h>
Inheritance diagram for NLNET::CBufClient:
List of all members.
Detailed Description
Client class for layer 1.
Active connection with packet scheme and buffering. The provided buffers are sent raw (no endianness conversion). By default, the size time trigger is disabled, the time trigger is set to 20 ms.
Where do the methods take place: \begincode send() -> send buffer -> update(), flush(), bytesUploaded(), newBytesUploaded()
receive(), <- receive buffer <- receive thread, dataAvailable(), bytesDownloaded(), newBytesDownloaded() disconnection callback
-
Author:
-
Olivier Cado , Nevrax France
-
Date:
-
2001
Definition at line 91 of file buf_client.h.
Constructor & Destructor Documentation
NLNET::CBufClient::CBufClient |
( |
bool |
nodelay = true, |
|
|
bool |
replaymode = false |
|
) |
|
|
NLNET::CBufClient::~CBufClient |
( |
|
) |
[virtual] |
|
Member Function Documentation
uint64 NLNET::CBufClient::bytesDownloaded |
( |
|
) |
const [inline] |
|
|
Returns the number of bytes downloaded (read or still in the receive buffer) since the latest connection.
Definition at line 163 of file buf_client.h.
References _BufSock.
Referenced by newBytesDownloaded. |
uint64 NLNET::CBufClient::bytesUploaded |
( |
|
) |
const [inline] |
|
void NLNET::CBufClient::connect |
( |
const CInetAddress & |
addr |
) |
|
|
bool NLNET::CBufClient::connected |
( |
|
) |
const [inline] |
|
|
Returns true if the connection is still connected (changed when a disconnection event has reached the front of the receive queue, just before calling the disconnection callback if there is one).
Reimplemented in NLNET::CCallbackClient.
Definition at line 157 of file buf_client.h.
References _BufSock. |
bool NLNET::CBufClient::dataAvailable |
( |
|
) |
|
|
|
Checks if there is some data to receive.
Returns false if the receive queue is empty. This is where the connection/disconnection callbacks can be called
Reimplemented in NLNET::CCallbackClient.
Definition at line 130 of file buf_client.cpp.
References _BufSock, NLNET::CBufNetBase::argOfDisconnectionCallback, NLNET::CFifoAccessor, NLNET::CBufNetBase::dataAvailableFlag, NLNET::CBufNetBase::disconnectionCallback, id, nldebug, nlerror, nlinfo, NLNET::CBufNetBase::receiveQueue, and NLNET::CBufNetBase::setDataAvailableFlag. |
void NLNET::CBufClient::disconnect |
( |
bool |
quick = false |
) |
|
|
bool NLNET::CBufClient::flush |
( |
|
) |
[inline] |
|
uint32 NLNET::CBufClient::getSendQueueSize |
( |
|
) |
const [inline] |
|
TSockId NLNET::CBufClient::id |
( |
|
) |
const [inline] |
|
uint64 NLNET::CBufClient::newBytesDownloaded |
( |
|
) |
|
|
uint64 NLNET::CBufClient::newBytesUploaded |
( |
|
) |
|
|
const CInetAddress& NLNET::CBufClient::remoteAddress |
( |
|
) |
const [inline] |
|
void NLNET::CBufClient::setSizeFlushTrigger |
( |
sint32 |
size |
) |
[inline] |
|
|
Sets the size flush trigger.
When the size of the send queue reaches or exceeds this calue, all data in the send queue is automatically sent (-1 to disable this trigger )
Definition at line 143 of file buf_client.h.
References _BufSock. |
void NLNET::CBufClient::setTimeFlushTrigger |
( |
sint32 |
ms |
) |
[inline] |
|
|
Sets the time flush trigger (in millisecond).
When this time is elapsed, all data in the send queue is automatically sent (-1 to disable this trigger)
Definition at line 138 of file buf_client.h.
References _BufSock. |
void NLNET::CBufClient::update |
( |
|
) |
|
|
Friends And Related Function Documentation
friend class CClientReceiveTask [friend]
|
|
Member Data Documentation
CBufSock* NLNET::CBufClient::_BufSock [protected]
|
|
|
Send buffer and connection.
Definition at line 197 of file buf_client.h.
Referenced by bytesDownloaded, bytesUploaded, CBufClient, NLNET::CCallbackClient::connect, connect, connected, dataAvailable, NLNET::CCallbackClient::disconnect, disconnect, flush, getSendQueueSize, id, remoteAddress, send, setSizeFlushTrigger, setTimeFlushTrigger, update, and ~CBufClient. |
bool NLNET::CBufClient::_NoDelay [protected]
|
|
uint64 NLNET::CBufClient::_PrevBytesDownloaded [protected]
|
|
uint64 NLNET::CBufClient::_PrevBytesUploaded [protected]
|
|
The documentation for this class was generated from the following files:
|
|