Index: src/OFHTTPServer.m ================================================================== --- src/OFHTTPServer.m +++ src/OFHTTPServer.m @@ -684,19 +684,19 @@ OF_GETTER(_name, true) } - (void)start { - if (_host == nil || _port == 0) + if (_host == nil) @throw [OFInvalidArgumentException exception]; if (_listeningSocket != nil) @throw [OFAlreadyConnectedException exception]; _listeningSocket = [[OFTCPSocket alloc] init]; - [_listeningSocket bindToHost: _host - port: _port]; + _port = [_listeningSocket bindToHost: _host + port: _port]; [_listeningSocket listen]; [_listeningSocket asyncAcceptWithTarget: self selector: @selector(OF_socket: didAcceptSocket: