namespace Msp {
namespace Http {
+Server::Server():
+ sock(Net::INET6),
+ event_disp(0)
+{ }
+
Server::Server(unsigned port):
sock(Net::INET6),
event_disp(0)
{
- sock.signal_data_available.connect(sigc::mem_fun(this, &Server::data_available));
- RefPtr<Net::SockAddr> addr = Net::resolve("*", format("%d", port), Net::INET6);
- sock.listen(*addr, 8);
+ listen(port);
}
// Avoid emitting sigc::signal destructor in files including server.h
{
}
+void Server::listen(unsigned port)
+{
+ RefPtr<Net::SockAddr> addr = Net::resolve("*", format("%d", port), Net::INET6);
+ sock.listen(*addr, 8);
+ sock.signal_data_available.connect(sigc::mem_fun(this, &Server::data_available));
+}
+
unsigned Server::get_port() const
{
const Net::SockAddr &addr = sock.get_local_address();
IO::EventDispatcher *event_disp;
public:
+ Server();
Server(unsigned);
~Server();
+ void listen(unsigned);
unsigned get_port() const;
void use_event_dispatcher(IO::EventDispatcher *);
void delay_response(Response &);