00001 #ifndef N2NC_NETSOCKETEVENTS_H
00002 #define N2NC_NETSOCKETEVENTS_H
00003
00004 #include "socketeventshandler.h"
00005 #include "tcpsocket.h"
00006
00007 namespace n2nc {
00008 namespace net {
00009
00010
00011
00012
00017 class SocketEvents{
00018 public:
00019 SocketEvents();
00020 ~SocketEvents();
00021
00022 protected:
00023
00024 virtual int onReceive(Socket& sock,int dtlen)=0;
00025 virtual int onNewConnection(Socket& sock)=0;
00026
00027 virtual int onWriteComplete(Socket& sock)=0;
00028
00029 virtual int onClose(Socket& sock)=0;
00030 virtual int onError(Socket& sock)=0;
00031 virtual int onRawReceive(Socket& sock)=0;
00032
00033
00035
00036 virtual int onSelectEvent(SocketEventsHandler::socket_extra_t* sock_extra,SocketEventsHandler::check_for_t cause );
00037
00038 private:
00039
00040 char *m_recvbuff;
00041
00042 friend class SocketEventsHandler;
00043
00044 };
00045
00046 }
00047
00048 }
00049
00050 #endif