added server error exception system; moved host and message size validation into server, references #7, sessions now have a pointer back to the server so they can ask it about server wide policy.

This commit is contained in:
Peter Thorson
2011-09-10 10:29:25 -05:00
parent bbeba1b214
commit e5b307652e
8 changed files with 146 additions and 61 deletions

View File

@@ -59,10 +59,19 @@ int main(int argc, char* argv[]) {
new websocketpp::server(io_service,endpoint,echo_handler)
);
// setup server settings
server->add_host(host);
// bump up max message size to maximum since we may be using the echo
// server to test performance and protocol extremes.
server->set_max_message_size(websocketpp::frame::PAYLOAD_64BIT_LIMIT);
// start the server
server->start_accept();
std::cout << "Starting echo server on " << host << std::endl;
// start asio
io_service.run();
} catch (std::exception& e) {
std::cerr << "Exception: " << e.what() << std::endl;