@@ -207,14 +207,13 @@ ssize_t ret; if (sock < 0) @throw [OFNotConnectedException newWithObject: self]; - if ((ret = recv(sock, buf, size, 0)) < 0) { - /* FIXME: Throw exception */ - return 0; - } + if ((ret = recv(sock, buf, size, 0)) < 0) + @throw [OFReadFailedException newWithObject: self + andSize: size]; /* This is safe, as we already checked < 0 */ return ret; } @@ -244,14 +243,13 @@ ssize_t ret; if (sock < 0) @throw [OFNotConnectedException newWithObject: self]; - if ((ret = send(sock, buf, size, 0)) < 0) { - /* FIXME: Throw exception */ - return 0; - } + if ((ret = send(sock, buf, size, 0)) < 0) + @throw [OFWriteFailedException newWithObject: self + andSize: size]; /* This is safe, as we already checked < 0 */ return ret; }