Differences From Artifact [72deb2c0c0]:
- File
src/OFUDPSocket.m
— part of check-in
[5025cba435]
at
2014-01-27 22:01:46
on branch trunk
— Add OFUDPSocket
Async operations will follow later. (user: js, size: 6856) [annotate] [blame] [check-ins using]
To Artifact [e5e2000892]:
- File src/OFUDPSocket.m — part of check-in [c4f36e3692] at 2014-01-29 15:59:01 on branch trunk — OFUDPSocket: Add observing (user: js, size: 6964) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 | @throw [OFNotConnectedException exceptionWithSocket: self]; if (sendto(_socket, buffer, length, 0, (struct sockaddr*)&receiver->address, receiver->length) < length) @throw [OFWriteFailedException exceptionWithObject: self requestedLength: length]; } - (void)close { if (_socket == INVALID_SOCKET) @throw [OFNotConnectedException exceptionWithSocket: self]; close(_socket); _socket = INVALID_SOCKET; } @end | > > > > > > > > > > | 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | @throw [OFNotConnectedException exceptionWithSocket: self]; if (sendto(_socket, buffer, length, 0, (struct sockaddr*)&receiver->address, receiver->length) < length) @throw [OFWriteFailedException exceptionWithObject: self requestedLength: length]; } - (int)fileDescriptorForReading { return _socket; } - (int)fileDescriptorForWriting { return _socket; } - (void)close { if (_socket == INVALID_SOCKET) @throw [OFNotConnectedException exceptionWithSocket: self]; close(_socket); _socket = INVALID_SOCKET; } @end |