diff options
Diffstat (limited to 'lib/HttpServ.cc')
-rw-r--r-- | lib/HttpServ.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/HttpServ.cc b/lib/HttpServ.cc index cda572d..c534741 100644 --- a/lib/HttpServ.cc +++ b/lib/HttpServ.cc @@ -361,13 +361,17 @@ String ProcessRequest::GetMime(const String & f) { HttpServ::HttpServ(Action * ap, int port, const String & nname) throw (GeneralException) : p(ap), name(nname), localport(port) { bool r = true; + cerr << "Initialising Mini HTTP-Server on port " << localport << endl; + r = Listener.SetLocal("", port); - if (r) { - r = Listener.Listen(); + if (!r) { + throw GeneralException("Initialisation of the Mini HTTP-Server failed: can't bind"); } + r = Listener.Listen(); + if (!r) { - throw GeneralException("Initialisation of the Mini HTTP-Server failed."); + throw GeneralException("Initialisation of the Mini HTTP-Server failed: can't listen"); } Listener.SetNonBlock(); |