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