@@ -151,27 +151,25 @@ - listenWithBackLog: (int)backlog { if (sock < 0) @throw [OFNotConnectedException newWithObject: self]; - if (listen(sock, backlog) < 0 ) { - /* FIXME: Throw exception */ - return nil; - } + if (listen(sock, backlog) < 0) + @throw [OFListenFailedException newWithObject: self + andBackLog: backlog]; return self; } - listen { if (sock < 0) @throw [OFNotConnectedException newWithObject: self]; - if (listen(sock, 5) < 0 ) { - /* FIXME: Throw exception */ - return nil; - } + if (listen(sock, 5) < 0) + @throw [OFListenFailedException newWithObject: self + andBackLog: 5]; return self; } - (OFTCPSocket*)accept @@ -190,12 +188,12 @@ [newsock free]; @throw e; } if ((s = accept(sock, addr, &addrlen)) < 0) { - /* FIXME: Throw exception */ - return nil; + [newsock free]; + @throw [OFAcceptFailedException newWithObject: self]; } [newsock setSocket: s]; [newsock setSocketAddress: addr withLength: addrlen];