@@ -24,11 +24,11 @@ #import "OFDDPSocket.h" #import "OFSocket.h" #import "OFSocket+Private.h" #import "OFAlreadyConnectedException.h" -#import "OFBindFailedException.h" +#import "OFBindDDPSocketFailedException.h" @implementation OFDDPSocket @dynamic delegate; - (OFSocketAddress)bindToPort: (uint8_t)port @@ -43,11 +43,11 @@ address = OFSocketAddressMakeAppleTalk(0, 0, port); if ((_socket = socket(address.sockaddr.at.sat_family, SOCK_DGRAM | SOCK_CLOEXEC, 0)) == OFInvalidSocketHandle) - @throw [OFBindFailedException + @throw [OFBindDDPSocketFailedException exceptionWithPort: port socket: self errNo: OFSocketErrNo()]; _canBlock = true; @@ -62,13 +62,14 @@ int errNo = OFSocketErrNo(); closesocket(_socket); _socket = OFInvalidSocketHandle; - @throw [OFBindFailedException exceptionWithPort: port - socket: self - errNo: errNo]; + @throw [OFBindDDPSocketFailedException + exceptionWithPort: port + socket: self + errNo: errNo]; } memset(&address, 0, sizeof(address)); address.family = OFSocketAddressFamilyAppleTalk; address.length = (socklen_t)sizeof(address.sockaddr); @@ -78,22 +79,24 @@ int errNo = OFSocketErrNo(); closesocket(_socket); _socket = OFInvalidSocketHandle; - @throw [OFBindFailedException exceptionWithPort: port - socket: self - errNo: errNo]; + @throw [OFBindDDPSocketFailedException + exceptionWithPort: port + socket: self + errNo: errNo]; } if (address.sockaddr.at.sat_family != AF_APPLETALK) { closesocket(_socket); _socket = OFInvalidSocketHandle; - @throw [OFBindFailedException exceptionWithPort: port - socket: self - errNo: EAFNOSUPPORT]; + @throw [OFBindDDPSocketFailedException + exceptionWithPort: port + socket: self + errNo: EAFNOSUPPORT]; } return address; } @end