Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _ECHO_H_
00020 #define _ECHO_H_
00021
00022 #include <vector>
00023 #include <boost/shared_ptr.hpp>
00024 #include <boost/shared_array.hpp>
00025 #include <boost/scoped_array.hpp>
00026 #include <sstream>
00027
00028
00029 #include "amf.h"
00030 #include "buffer.h"
00031 #include "element.h"
00032 #include "http.h"
00033 #include "cygnal.h"
00034
00035
00036 #include "rtmp_server.h"
00037 #include "handler.h"
00038
00039 namespace cygnal
00040 {
00041
00042 class EchoTest : public cygnal::RTMPServer
00043 {
00044 public:
00045 EchoTest ();
00046 ~EchoTest ();
00047
00048
00049 std::vector<boost::shared_ptr<cygnal::Element > > parseEchoRequest(cygnal::Buffer &buf)
00050 { return parseEchoRequest(buf.reference(), buf.size()); };
00051 std::vector<boost::shared_ptr<cygnal::Element > > parseEchoRequest(boost::uint8_t *buf, size_t size);
00052
00053
00054 boost::shared_ptr<cygnal::Buffer> formatEchoResponse(double num, cygnal::Element &el);
00055 boost::shared_ptr<cygnal::Buffer> formatEchoResponse(double num, cygnal::Buffer &data);
00056 boost::shared_ptr<cygnal::Buffer> formatEchoResponse(double num, boost::uint8_t *data, size_t size);
00057
00058 boost::shared_ptr<cygnal::Buffer> getResponse() { return _response; };
00059 void setResponse(boost::shared_ptr<cygnal::Buffer> &x) { _response = x; };
00060
00061 void setNetConnection(gnash::RTMPMsg *msg) { _netconnect.reset(msg); };
00062 void setNetConnection(boost::shared_ptr<gnash::RTMPMsg> msg) { _netconnect = msg; };
00063 boost::shared_ptr<gnash::RTMPMsg> getNetConnection() { return _netconnect;};
00064
00065 private:
00066 boost::shared_ptr<cygnal::Buffer> _response;
00067 boost::shared_ptr<Handler::cygnal_init_t> _info;
00073 boost::shared_ptr<gnash::RTMPMsg> _netconnect;
00074 };
00075
00076
00077 extern "C" {
00078 boost::shared_ptr<Handler::cygnal_init_t>echo_init_func(boost::shared_ptr<gnash::RTMPMsg> &msg);
00079
00080 boost::shared_ptr<cygnal::Buffer> echo_read_func();
00081 size_t echo_write_func(boost::uint8_t *data, size_t size);
00082 }
00083
00084 }
00085 #endif // end of __ECHO_H__
00086
00087
00088
00089
00090