00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef MDWHTTPPROTOCOL_H
00021 #define MDWHTTPPROTOCOL_H
00022
00023 #include "StreamServerApi.h"
00024
00025 namespace mdw
00026 {
00027
00031 class HttpProtocol : public StreamServerVisitor, StreamSizeServer
00032 {
00033 public:
00034 HttpProtocol (StreamServer &server);
00035 ~HttpProtocol();
00036
00037 virtual void visitRead (std::vector<char> &buffer, int start, int streamId);
00038 virtual void visitConnect (int streamId, std::string &ip);
00039 virtual void visitDisconnect (int streamId);
00040
00041 virtual void accept (StreamSizeServerVisitor &visitor, int timeOutSec, int timeOutMicro);
00042 virtual void accept (StreamServerVisitor &visitor, int timeOutSec, int timeOutMicro);
00043 virtual void write (const char* buffer, int size, int streamId);
00044 virtual Stream &outStream (int streamId);
00045 virtual void close (int streamId);
00046
00047 private:
00048 StreamServer &_server;
00049 StreamServerVisitor *_currentVisitor;
00050
00051 };
00052
00053 }
00054
00055 #endif