@@ -48,11 +48,11 @@ #if SOCK_CLOEXEC == 0 && defined(HAVE_FCNTL) && defined(FD_CLOEXEC) int flags; #endif if ((_socket = socket(address->sockaddr.sockaddr.sa_family, - SOCK_DGRAM | SOCK_CLOEXEC | extraType, 0)) == INVALID_SOCKET) + SOCK_DGRAM | SOCK_CLOEXEC | extraType, 0)) == OFInvalidSocketHandle) @throw [OFBindFailedException exceptionWithHost: OFSocketAddressString(address) port: OFSocketAddressPort(address) socket: self errNo: OFSocketErrNo()]; @@ -72,11 +72,11 @@ if (bind(_socket, &address->sockaddr.sockaddr, address->length) != 0) { int errNo = OFSocketErrNo(); closesocket(_socket); - _socket = INVALID_SOCKET; + _socket = OFInvalidSocketHandle; @throw [OFBindFailedException exceptionWithHost: OFSocketAddressString(address) port: OFSocketAddressPort(address) socket: self @@ -103,11 +103,11 @@ int errNo = OFSocketErrNo(); OFString *host = OFSocketAddressString(address); uint16_t port = OFSocketAddressPort(port); closesocket(_socket); - _socket = INVALID_SOCKET; + _socket = OFInvalidSocketHandle; @throw [OFBindFailedException exceptionWithHost: host port: port socket: self @@ -129,11 +129,11 @@ if (OFGetSockName(_socket, &address->sockaddr.sockaddr, &address->length) != 0) { int errNo = OFSocketErrNo(); closesocket(_socket); - _socket = INVALID_SOCKET; + _socket = OFInvalidSocketHandle; @throw [OFBindFailedException exceptionWithHost: OFSocketAddressString(address) port: OFSocketAddressPort(address) socket: self @@ -146,21 +146,21 @@ else if (address->sockaddr.sockaddr.sa_family == AF_INET6) return OFFromBigEndian16(address->sockaddr.in6.sin6_port); # endif else { closesocket(_socket); - _socket = INVALID_SOCKET; + _socket = OFInvalidSocketHandle; @throw [OFBindFailedException exceptionWithHost: OFSocketAddressString(address) port: OFSocketAddressPort(address) socket: self errNo: EAFNOSUPPORT]; } #else closesocket(_socket); - _socket = INVALID_SOCKET; + _socket = OFInvalidSocketHandle; @throw [OFBindFailedException exceptionWithHost: OFSocketAddressString(address) port: OFSocketAddressPort(address) socket: self @@ -172,11 +172,11 @@ { void *pool = objc_autoreleasePoolPush(); OFData *socketAddresses; OFSocketAddress address; - if (_socket != INVALID_SOCKET) + if (_socket != OFInvalidSocketHandle) @throw [OFAlreadyConnectedException exceptionWithSocket: self]; socketAddresses = [[OFThread DNSResolver] resolveAddressesForHost: host addressFamily: OFSocketAddressFamilyAny];