@@ -243,11 +243,11 @@ exceptionWithHost: host port: port socket: self errNo: of_socket_errno()]; - _blocking = true; + _canBlock = true; #if SOCK_CLOEXEC == 0 && defined(HAVE_FCNTL) && defined(FD_CLOEXEC) if ((flags = fcntl(_socket, F_GETFD, 0)) != -1) fcntl(_socket, F_SETFD, flags | FD_CLOEXEC); #endif @@ -303,22 +303,22 @@ socket: self errNo: EAFNOSUPPORT]; } } -- (void)setNoDelayEnabled: (bool)enabled +- (void)setCanDelaySendingPackets: (bool)canDelaySendingPackets { - int v = enabled; + int v = !canDelaySendingPackets; if (setsockopt(_socket, IPPROTO_SCTP, SCTP_NODELAY, (char *)&v, (socklen_t)sizeof(v)) != 0) @throw [OFSetOptionFailedException exceptionWithObject: self errNo: of_socket_errno()]; } -- (bool)isNoDelayEnabled +- (bool)canDelaySendingPackets { int v; socklen_t len = sizeof(v); if (getsockopt(_socket, IPPROTO_SCTP, SCTP_NODELAY, @@ -325,8 +325,8 @@ (char *)&v, &len) != 0 || len != sizeof(v)) @throw [OFGetOptionFailedException exceptionWithObject: self errNo: of_socket_errno()]; - return v; + return !v; } @end