00001 #ifndef _sys_AsynchIOHandler_h
00002 #define _sys_AsynchIOHandler_h
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "OutputControl.h"
00025 #include "ConnectionCodec.h"
00026
00027 namespace qpid {
00028
00029 namespace framing {
00030 class ProtocolInitiation;
00031 }
00032
00033 namespace sys {
00034
00035 class AsynchIO;
00036 class AsynchIOBufferBase;
00037 class Socket;
00038
00039 class AsynchIOHandler : public OutputControl {
00040 std::string identifier;
00041 AsynchIO* aio;
00042 ConnectionCodec::Factory* factory;
00043 ConnectionCodec* codec;
00044 bool readError;
00045 bool isClient;
00046
00047 void write(const framing::ProtocolInitiation&);
00048
00049 public:
00050 AsynchIOHandler(std::string id, ConnectionCodec::Factory* f);
00051 ~AsynchIOHandler();
00052 void init(AsynchIO* a, int numBuffs);
00053
00054 void setClient() { isClient = true; }
00055
00056
00057 void close();
00058 void activateOutput();
00059
00060
00061 void readbuff(AsynchIO& aio, AsynchIOBufferBase* buff);
00062 void eof(AsynchIO& aio);
00063 void disconnect(AsynchIO& aio);
00064
00065
00066 void nobuffs(AsynchIO& aio);
00067 void idle(AsynchIO& aio);
00068 void closedSocket(AsynchIO& aio, const Socket& s);
00069 };
00070
00071 }}
00072
00073 #endif // _sys_AsynchIOHandler_h