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 #include "AsynchIO.h"
00027
00028 namespace qpid {
00029
00030 namespace framing {
00031 class ProtocolInitiation;
00032 }
00033
00034 namespace sys {
00035 class ProtocolAccess;
00036 class AsynchIOHandler : public OutputControl {
00037 std::string identifier;
00038 AsynchIO* aio;
00039 ConnectionCodec::Factory* factory;
00040 ConnectionCodec* codec;
00041 bool readError;
00042 bool isClient;
00043 ProtocolAccess* access;
00044
00045 void write(const framing::ProtocolInitiation&);
00046
00047 public:
00048 AsynchIOHandler(std::string id, ConnectionCodec::Factory* f, ProtocolAccess* a =0);
00049 ~AsynchIOHandler();
00050 void init(AsynchIO* a, int numBuffs);
00051
00052 void setClient() { isClient = true; }
00053
00054
00055 void close();
00056 void activateOutput();
00057
00058
00059 void readbuff(AsynchIO& aio, AsynchIO::BufferBase* buff);
00060 void eof(AsynchIO& aio);
00061 void disconnect(AsynchIO& aio);
00062
00063
00064 void nobuffs(AsynchIO& aio);
00065 void idle(AsynchIO& aio);
00066 void closedSocket(AsynchIO& aio, const Socket& s);
00067 };
00068
00069 }}
00070
00071 #endif // _sys_AsynchIOHandler_h