Logo Search packages:      
Sourcecode: verlihub version File versions

nServer::cAsyncConn Class Reference

#include <casyncconn.h>

Inheritance diagram for nServer::cAsyncConn:

nServer::cConnBase cObj nDirectConnect::cConnDC

List of all members.


Detailed Description

a network connection for asynchronous (rather non-blocking) server
Author:
Daniel Muller

Janos Horvath (udp support)

Definition at line 89 of file casyncconn.h.


Public Member Functions

virtual cAsyncConnAccept ()
const string & AddrHost ()
const string & AddrIP ()
const int AddrPort ()
int BufferEmpty ()
 cAsyncConn (const string &host, int port, bool udp=false)
 cAsyncConn (int sd=0, cAsyncSocketServer *s=NULL, tConnType ct=eCT_CLIENT)
void ClearLine ()
void Close ()
void CloseNice (int msec=0)
void CloseNow ()
int Connect (const string &, int)
virtual cMessageParser * CreateParser ()
virtual void DeleteParser (cMessageParser *)
bool DNSLookup ()
bool DNSResolveReverse (const string &ip, string &host)
virtual std::ostream & ErrLog ()
int ErrLog (int level)
virtual string * FactoryString ()
void Flush ()
string * GetLine ()
const unsigned long GetSockAddress ()
int GetSockOpt (int optname, void *optval, int &optlen)
tConnType GetType ()
virtual const tConnType & getType ()
int LineStatus ()
int ListenOnPort (int port, const char *ia=NULL, bool udp=false)
virtual std::ostream & Log ()
int Log (int level)
std::ostream & LogStream ()
virtual void OnFlushDone ()
virtual int OnTimer (cTime &now)
int OnTimerBase (cTime &now)
virtual operator tSocket () const
int ReadAll ()
int ReadLineLocal ()
void SetClassName (const char *name)
void SetLineToRead (string *, char, int max=-1)
int SetSockOpt (int optname, const void *optval, int optlen)
int SetupUDP (const string &, int)
virtual int StrLog (std::ostream &ostr, int level)
int Write (const string &data, bool Flush)

Static Public Member Functions

static unsigned long DNSResolveHost (const string &host)
static int GetCount ()
static const char * IPAsString (unsigned long addr)
static int SendUDPMsg (const string &host, int port, const string &data)

Public Attributes

const char * mClassName
int mExtraPoll
tCLIt mIterator
cMessageParser * mpMsgParser
tSocket mSockDesc
cTime mTimeLastIOAction
std::ostream * mToLog
bool mWritable
cConnFactory * mxAcceptingFactory
cConnFactory * mxMyFactory
cProtocolmxProtocol
cAsyncSocketServermxServer
bool ok

Static Public Attributes

static const string mEmpty
static int msLogLevel = 4
static unsigned long sSocketCounter = 0

Protected Member Functions

tSocket AcceptSock ()
int BindSocket (int sock, int port, const char *addr=NULL)
tSocket CreateSock (bool udp=false)
virtual cConnFactory * GetAcceptingFactory ()
int ListenSock (int sock)
tSocket NonBlockSock (int sock)
virtual int OnCloseNice (void)
int SendAll (const char *buf, size_t &len)

Protected Attributes

string mAddrHost
struct sockaddr_in mAddrIN
string mAddrIP
int mAddrPort
string mBufSend
unsigned long mIp
int mLineSize
unsigned mLineSizeMax
unsigned long mMaxBuffer
char mSeparator
tConnType mType

Static Protected Attributes

static char * msBuffer = new char[MAX_MESS_SIZE+1]

Private Types

typedef tConnList::iterator tCLIt
typedef list< cAsyncConn * > tConnList

Private Attributes

int mBufEnd
int mBufReadPos
cTime mCloseAfter
int meLineStatus
int mRegFlag
string * mxLine

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

Generated by  Doxygen 1.6.0   Back to index