@@ -48,11 +48,11 @@ + (void)initialize { if (self != [OFDatagramSocket class]) return; - if (!of_socket_init()) + if (!OFSocketInit()) @throw [OFInitializationFailedException exceptionWithClass: self]; } + (instancetype)socket @@ -121,11 +121,11 @@ u_long v = canBlock; if (ioctlsocket(_socket, FIONBIO, &v) == SOCKET_ERROR) @throw [OFSetOptionFailedException exceptionWithObject: self - errNo: of_socket_errno()]; + errNo: OFSocketErrNo()]; _canBlock = canBlock; #else OF_UNRECOGNIZED_SELECTOR #endif @@ -137,11 +137,11 @@ if (setsockopt(_socket, SOL_SOCKET, SO_BROADCAST, (char *)&v, (socklen_t)sizeof(v)) != 0) @throw [OFSetOptionFailedException exceptionWithObject: self - errNo: of_socket_errno()]; + errNo: OFSocketErrNo()]; #ifdef OF_WII _canSendToBroadcastAddresses = canSendToBroadcastAddresses; #endif } @@ -154,11 +154,11 @@ if (getsockopt(_socket, SOL_SOCKET, SO_BROADCAST, (char *)&v, &len) != 0 || len != sizeof(v)) @throw [OFGetOptionFailedException exceptionWithObject: self - errNo: of_socket_errno()]; + errNo: OFSocketErrNo()]; return v; #else return _canSendToBroadcastAddresses; #endif @@ -179,21 +179,21 @@ if ((ret = recvfrom(_socket, buffer, length, 0, &sender->sockaddr.sockaddr, &sender->length)) < 0) @throw [OFReadFailedException exceptionWithObject: self requestedLength: length - errNo: of_socket_errno()]; + errNo: OFSocketErrNo()]; #else if (length > INT_MAX) @throw [OFOutOfRangeException exception]; if ((ret = recvfrom(_socket, buffer, (int)length, 0, &sender->sockaddr.sockaddr, &sender->length)) < 0) @throw [OFReadFailedException exceptionWithObject: self requestedLength: length - errNo: of_socket_errno()]; + errNo: OFSocketErrNo()]; #endif switch (sender->sockaddr.sockaddr.sa_family) { case AF_INET: sender->family = OFSocketAddressFamilyIPv4; @@ -280,11 +280,11 @@ receiver->length)) < 0) @throw [OFWriteFailedException exceptionWithObject: self requestedLength: length bytesWritten: 0 - errNo: of_socket_errno()]; + errNo: OFSocketErrNo()]; #else int bytesWritten; if (length > INT_MAX) @throw [OFOutOfRangeException exception]; @@ -293,11 +293,11 @@ &receiver->sockaddr.sockaddr, receiver->length)) < 0) @throw [OFWriteFailedException exceptionWithObject: self requestedLength: length bytesWritten: 0 - errNo: of_socket_errno()]; + errNo: OFSocketErrNo()]; #endif if ((size_t)bytesWritten != length) @throw [OFWriteFailedException exceptionWithObject: self requestedLength: length