Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef SERVER_H
- #define SERVER_H
- #include <iostream>
- #include <boost/asio.hpp>
- #include <boost/bind.hpp>
- #include <boost/bind/placeholders.hpp>
- #include "Connection.h"
- #include <string>
- #include <vector>
- class Server{
- tcp::acceptor accept;
- boost::asio::io_service io_service;
- std::vector<Connection::pointer> connections;
- public:
- Server(boost::asio::io_service& io_service, int port=23);
- Server(int port = 23);
- void msgHandler(std::string msg);
- private:
- void waitForConnection();
- void acceptConnection(Connection::pointer connection, const boost::system::error_code& error);
- };
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement