@@ -1,8 +1,8 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 - * Jonathan Schleifer + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 + * Jonathan Schleifer * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in @@ -592,14 +592,19 @@ if (setsockopt(_socket, SOL_SOCKET, SO_KEEPALIVE, (char*)&v, (socklen_t)sizeof(v)) != 0) @throw [OFSetOptionFailedException exceptionWithStream: self errNo: of_socket_errno()]; + +#ifdef __wii__ + _keepAliveEnabled = enabled; +#endif } - (bool)isKeepAliveEnabled { +#ifndef __wii__ int v; socklen_t len = sizeof(v); if (getsockopt(_socket, SOL_SOCKET, SO_KEEPALIVE, (char*)&v, &len) != 0 || len != sizeof(v)) @@ -606,10 +611,13 @@ @throw [OFGetOptionFailedException exceptionWithStream: self errNo: of_socket_errno()]; return v; +#else + return _keepAliveEnabled; +#endif } - (void)setTCPNoDelayEnabled: (bool)enabled { int v = enabled; @@ -617,14 +625,19 @@ if (setsockopt(_socket, IPPROTO_TCP, TCP_NODELAY, (char*)&v, (socklen_t)sizeof(v)) != 0) @throw [OFSetOptionFailedException exceptionWithStream: self errNo: of_socket_errno()]; + +#ifdef __wii__ + _TCPNoDelayEnabled = enabled; +#endif } - (bool)isTCPNoDelayEnabled { +#ifndef __wii__ int v; socklen_t len = sizeof(v); if (getsockopt(_socket, IPPROTO_TCP, TCP_NODELAY, (char*)&v, &len) != 0 || len != sizeof(v)) @@ -631,7 +644,10 @@ @throw [OFGetOptionFailedException exceptionWithStream: self errNo: of_socket_errno()]; return v; +#else + return _TCPNoDelayEnabled; +#endif } @end