initial commit

This commit is contained in:
Peter Thorson
2011-09-07 20:27:29 -05:00
commit fa73c478e9
34 changed files with 3581 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
#ifndef ECHO_HANDLER_HPP
#define ECHO_HANDLER_HPP
#include "../../src/websocket_connection_handler.hpp"
#include <boost/shared_ptr.hpp>
#include <string>
#include <vector>
namespace websocketecho {
class echo_handler : public websocketpp::connection_handler {
public:
echo_handler() {}
virtual ~echo_handler() {}
// The echo server allows all domains is protocol free.
bool validate(websocketpp::session_ptr client);
// an echo server is stateless. The handler has no need to keep track of connected
// clients.
void connect(websocketpp::session_ptr client) {}
void disconnect(websocketpp::session_ptr client,const std::string &reason) {}
// both text and binary messages are echoed back to the sending client.
void message(websocketpp::session_ptr client,const std::string &msg);
void message(websocketpp::session_ptr client,
const std::vector<unsigned char> &data);
};
typedef boost::shared_ptr<echo_handler> echo_handler_ptr;
}
#endif // ECHO_HANDLER_HPP