@@ -498,17 +498,21 @@ @throw [OFSetOptionFailedException exceptionWithStream: self]; } - (OFString*)remoteAddress { + OFString *ret; + if (_socket == INVALID_SOCKET) @throw [OFNotConnectedException exceptionWithSocket: self]; if (_address == NULL) @throw [OFInvalidArgumentException exception]; - return of_address_to_string_and_port(_address, _addressLength, NULL); + of_address_to_string_and_port(_address, _addressLength, &ret, NULL); + + return ret; } - (bool)isListening { return _listening;