#include <exception>
#include <msp/core/refptr.h>
#include <msp/net/inet.h>
+#include <msp/net/resolve.h>
#include <msp/net/streamsocket.h>
+#include <msp/strings/format.h>
#include "request.h"
#include "response.h"
#include "server.h"
event_disp(0)
{
sock.signal_data_available.connect(sigc::mem_fun(this, &Server::data_available));
- sock.listen(Net::InetAddr(0, port), 8);
+ RefPtr<Net::SockAddr> addr = Net::resolve("*", format("%d", port));
+ sock.listen(*addr, 8);
}
unsigned Server::get_port() const