FrontPage|FindPage|TitleIndex|RecentChanges|RSS source_epbasic.h
 
/* ----------------------------------------------------------

 ep.cc by biscuit@actoz.com 
 for Linux 2.6.x

 v1.0 06/24/2004 first release

----------------------------------------------------------*/
#ifndef __EP_BASIC_H__
#define __EP_BASIC_H__

#include "epsocket.h"
#include "buffer.h"

#define MAX_BUF 819200

class TBasicClient : public TEpollClient
{
protected :
    TBinQueue *sendbuf, *recvbuf;

    bool is_would_block;
    bool is_error;

    unsigned nin, nout;

    virtual int internalbuffersize(void) { return MAX_BUF; };

public :
    int xfd;
    int lastsec;

    TBasicClient(const int lfd, const char *laddr) : TEpollClient(lfd, laddr)
    {
        // ÃʱâÈ­¶§ Ãß°¡ÀûÀ¸·Î ÇØÁÖ°í½ÍÀº ÀϵéÀÌ ÀÖ´Ù¸é ¿©±â¿¡ ...
        is_would_block = false;
        is_error       = false;

        nin = nout = 0;
        xfd = lfd;
        lastsec = 0;

        int maxbuf = internalbuffersize();
        sendbuf = new TBinQueue(maxbuf);
        recvbuf = new TBinQueue(maxbuf);
    };

    ~TBasicClient()
    {   
        delete sendbuf;
        delete recvbuf;
    };
    
    virtual int OnRead(void);
    virtual int OnWrite(void);
    virtual int OnError(const int nerror);
    virtual int OnIdle(void);
    virtual int Flush(void);
};

#endif 

last modified 2004-06-24 12:36:32
EditText|FindPage|DeletePage|LikePages|