Index: src/OFDatagramSocket.m ================================================================== --- src/OFDatagramSocket.m +++ src/OFDatagramSocket.m @@ -300,16 +300,14 @@ OFDatagramSocket *socket, void *buffer_, size_t length_, const OFSocketAddress *sender, id exception) { return block(length_, sender, exception); }; - [OFRunLoop of_addAsyncReceiveForDatagramSocket: self - buffer: buffer - length: length - mode: runLoopMode - handler: handler - delegate: nil]; + [self asyncReceiveIntoBuffer: buffer + length: length + runLoopMode: runLoopMode + handler: handler]; } - (void)asyncReceiveIntoBuffer: (void *)buffer length: (size_t)length runLoopMode: (OFRunLoopMode)runLoopMode Index: src/OFRunLoop+Private.h ================================================================== --- src/OFRunLoop+Private.h +++ src/OFRunLoop+Private.h @@ -100,11 +100,11 @@ mode: (OFRunLoopMode)mode delegate: (id )delegate; # endif + (void)of_addAsyncAcceptForSocket: (id)socket mode: (OFRunLoopMode)mode - block: (nullable id)block + handler: (nullable id)handler delegate: (nullable id)delegate; + (void)of_addAsyncReceiveForDatagramSocket: (OFDatagramSocket *)socket buffer: (void *)buffer length: (size_t)length mode: (OFRunLoopMode)mode @@ -124,19 +124,19 @@ (OFSequencedPacketSocket *)socket buffer: (void *)buffer length: (size_t)length mode: (OFRunLoopMode)mode # ifdef OF_HAVE_BLOCKS - block: (nullable OFSequencedPacketSocketAsyncReceiveBlock)block + handler: (nullable OFSequencedPacketSocketPacketReceivedHandler)handler # endif delegate: (nullable id )delegate; + (void)of_addAsyncSendForSequencedPacketSocket: (OFSequencedPacketSocket *)socket data: (OFData *)data mode: (OFRunLoopMode)mode # ifdef OF_HAVE_BLOCKS - block: (nullable OFSequencedPacketSocketAsyncSendDataBlock)block + handler: (nullable OFSequencedPacketSocketDataSentHandler)handler # endif delegate: (nullable id )delegate; # ifdef OF_HAVE_SCTP + (void)of_addAsyncReceiveForSCTPSocket: (OFSCTPSocket *)socket buffer: (void *)buffer Index: src/OFRunLoop.m ================================================================== --- src/OFRunLoop.m +++ src/OFRunLoop.m @@ -164,11 +164,11 @@ @interface OFRunLoopAcceptQueueItem: OFRunLoopQueueItem { @public # ifdef OF_HAVE_BLOCKS - id _block; + id _handler; # endif } @end @interface OFRunLoopDatagramReceiveQueueItem: OFRunLoopQueueItem @@ -195,11 +195,11 @@ @interface OFRunLoopPacketReceiveQueueItem: OFRunLoopQueueItem { @public # ifdef OF_HAVE_BLOCKS - OFSequencedPacketSocketAsyncReceiveBlock _block; + OFSequencedPacketSocketPacketReceivedHandler _handler; # endif void *_buffer; size_t _length; } @end @@ -206,11 +206,11 @@ @interface OFRunLoopPacketSendQueueItem: OFRunLoopQueueItem { @public # ifdef OF_HAVE_BLOCKS - OFSequencedPacketSocketAsyncSendDataBlock _block; + OFSequencedPacketSocketDataSentHandler _handler; # endif OFData *_data; } @end @@ -844,18 +844,18 @@ acceptedSocket = nil; exception = e; } # ifdef OF_HAVE_BLOCKS - if (_block != NULL) { + if (_handler != NULL) { if ([object isKindOfClass: [OFStreamSocket class]]) - return ((OFStreamSocketAsyncAcceptBlock)_block)( + return ((OFStreamSocketAsyncAcceptBlock)_handler)( acceptedSocket, exception); else if ([object isKindOfClass: [OFSequencedPacketSocket class]]) - return ((OFSequencedPacketSocketAsyncAcceptBlock) - _block)(acceptedSocket, exception); + return ((OFSequencedPacketSocketAcceptedHandler) + _handler)(object, acceptedSocket, exception); else OFEnsure(0); } else { # endif if (![_delegate respondsToSelector: @@ -871,11 +871,11 @@ } # ifdef OF_HAVE_BLOCKS - (void)dealloc { - [_block release]; + [_handler release]; [super dealloc]; } # endif @end @@ -998,12 +998,12 @@ length = 0; exception = e; } # ifdef OF_HAVE_BLOCKS - if (_block != NULL) - return _block(length, exception); + if (_handler != NULL) + return _handler(object, _buffer, length, exception); else { # endif if (![_delegate respondsToSelector: @selector( socket:didReceiveIntoBuffer:length:exception:)]) return false; @@ -1018,11 +1018,11 @@ } # ifdef OF_HAVE_BLOCKS - (void)dealloc { - [_block release]; + [_handler release]; [super dealloc]; } # endif @end @@ -1039,12 +1039,12 @@ } @catch (id e) { exception = e; } # ifdef OF_HAVE_BLOCKS - if (_block != NULL) { - newData = _block(exception); + if (_handler != NULL) { + newData = _handler(object, _data, exception); if (newData == nil) return false; oldData = _data; @@ -1076,11 +1076,11 @@ } - (void)dealloc { # ifdef OF_HAVE_BLOCKS - [_block release]; + [_handler release]; # endif [_data release]; [super dealloc]; } @@ -1434,18 +1434,18 @@ } # endif + (void)of_addAsyncAcceptForSocket: (id)sock mode: (OFRunLoopMode)mode - block: (id)block + handler: (id)handler delegate: (id)delegate { NEW_READ(OFRunLoopAcceptQueueItem, sock, mode) queueItem->_delegate = [delegate retain]; # ifdef OF_HAVE_BLOCKS - queueItem->_block = [block copy]; + queueItem->_handler = [handler copy]; # endif QUEUE_ITEM } @@ -1495,19 +1495,19 @@ sock buffer: (void *)buffer length: (size_t)length mode: (OFRunLoopMode)mode # ifdef OF_HAVE_BLOCKS - block: (OFSequencedPacketSocketAsyncReceiveBlock)block + handler: (OFSequencedPacketSocketPacketReceivedHandler)handler # endif delegate: (id )delegate { NEW_READ(OFRunLoopPacketReceiveQueueItem, sock, mode) queueItem->_delegate = [delegate retain]; # ifdef OF_HAVE_BLOCKS - queueItem->_block = [block copy]; + queueItem->_handler = [handler copy]; # endif queueItem->_buffer = buffer; queueItem->_length = length; QUEUE_ITEM @@ -1515,19 +1515,19 @@ + (void)of_addAsyncSendForSequencedPacketSocket: (OFSequencedPacketSocket *)sock data: (OFData *)data mode: (OFRunLoopMode)mode # ifdef OF_HAVE_BLOCKS - block: (OFSequencedPacketSocketAsyncSendDataBlock)block + handler: (OFSequencedPacketSocketDataSentHandler)handler # endif delegate: (id )delegate { NEW_WRITE(OFRunLoopPacketSendQueueItem, sock, mode) queueItem->_delegate = [delegate retain]; # ifdef OF_HAVE_BLOCKS - queueItem->_block = [block copy]; + queueItem->_handler = [handler copy]; # endif queueItem->_data = [data copy]; QUEUE_ITEM } Index: src/OFSequencedPacketSocket.h ================================================================== --- src/OFSequencedPacketSocket.h +++ src/OFSequencedPacketSocket.h @@ -31,39 +31,91 @@ #ifdef OF_HAVE_BLOCKS /** * @brief A block which is called when a packet has been received. * + * @deprecated Use @ref OFSequencedPacketSocketPacketReceivedHandler instead. + * * @param length The length of the packet * @param exception An exception which occurred while receiving or `nil` on * success * @return A bool whether the same block should be used for the next receive */ typedef bool (^OFSequencedPacketSocketAsyncReceiveBlock)(size_t length, + id _Nullable exception) + OF_DEPRECATED(ObjFW, 1, 2, + "Use OFSequencedPacketSocketPacketReceivedHandler instead"); + +/** + * @brief A handler which is called when a packet has been received. + * + * @param socket The sequenced packet socket which received a packet + * @param buffer The buffer the packet has been written to + * @param length The length of the packet + * @param exception An exception which occurred while receiving or `nil` on + * success + * @return A bool whether the same handler should be used for the next receive + */ +typedef bool (^OFSequencedPacketSocketPacketReceivedHandler)( + OFSequencedPacketSocket *socket, void *buffer, size_t length, id _Nullable exception); /** * @brief A block which is called when a packet has been sent. + * + * @deprecated Use @ref OFSequencedPacketSocketDataSentHandler instead. * * @param exception An exception which occurred while reading or `nil` on * success * @return The data to repeat the send with or nil if it should not repeat */ typedef OFData *_Nullable (^OFSequencedPacketSocketAsyncSendDataBlock)( - id _Nullable exception); + id _Nullable exception) + OF_DEPRECATED(ObjFW, 1, 2, + "Use OFSequencedPacketSocketDataSentHandler instead"); + +/** + * @brief A handler which is called when a packet has been sent. + * + * @param socket The sequenced packet socket which sent a packet + * @param data The data which was sent + * @param exception An exception which occurred while reading or `nil` on + * success + * @return The data to repeat the send with or nil if it should not repeat + */ +typedef OFData *_Nullable (^OFSequencedPacketSocketDataSentHandler)( + OFSequencedPacketSocket *socket, OFData *data, id _Nullable exception); /** * @brief A block which is called when the socket accepted a connection. + * + * @deprecated Use OFSequencedPacketSocketAcceptedHandler instead. * * @param acceptedSocket The socket which has been accepted * @param exception An exception which occurred while accepting the socket or * `nil` on success * @return A bool whether the same block should be used for the next incoming * connection */ typedef bool (^OFSequencedPacketSocketAsyncAcceptBlock)( - OFSequencedPacketSocket *acceptedSocket, id _Nullable exception); + OFSequencedPacketSocket *acceptedSocket, id _Nullable exception) + OF_DEPRECATED(ObjFW, 1, 2, + "Use OFSequencedPacketSocketAcceptedHandler instead"); + +/** + * @brief A handler which is called when the socket accepted a connection. + * + * @param socket The socket which accepted the connection + * @param acceptedSocket The socket which has been accepted + * @param exception An exception which occurred while accepting the socket or + * `nil` on success + * @return A bool whether the same handler should be used for the next incoming + * connection + */ +typedef bool (^OFSequencedPacketSocketAcceptedHandler)( + OFSequencedPacketSocket *socket, OFSequencedPacketSocket *acceptedSocket, + id _Nullable exception); #endif /** * @protocol OFSequencedPacketSocketDelegate OFSequencedPacketSocket.h * ObjFW/ObjFW.h @@ -78,11 +130,11 @@ * @param socket The sequenced packet socket which received a packet * @param buffer The buffer the packet has been written to * @param length The length of the packet * @param exception An exception that occurred while receiving, or nil on * success - * @return A bool whether the same block should be used for the next receive + * @return A bool whether the same handler should be used for the next receive */ - (bool)socket: (OFSequencedPacketSocket *)socket didReceiveIntoBuffer: (void *)buffer length: (size_t)length exception: (nullable id)exception; @@ -223,10 +275,12 @@ #ifdef OF_HAVE_BLOCKS /** * @brief Asynchronously receives a packet and stores it into the specified * buffer. * + * @deprecated Use @ref asyncReceiveIntoBuffer:lenght:handler: instead. + * * If the buffer is too small, the receive operation fails. * * @param buffer The buffer to write the packet to * @param length The length of the buffer * @param block The block to call when the packet has been received. If the @@ -235,15 +289,40 @@ * If you want the next method in the queue to handle the packet * received next, you need to return false from the method. */ - (void)asyncReceiveIntoBuffer: (void *)buffer length: (size_t)length - block: (OFSequencedPacketSocketAsyncReceiveBlock)block; + block: (OFSequencedPacketSocketAsyncReceiveBlock)block + OF_DEPRECATED(ObjFW, 1, 2, + "Use -[asyncReceiveIntoBuffer:lenght:handler:] instead"); + +/** + * @brief Asynchronously receives a packet and stores it into the specified + * buffer. + * + * If the buffer is too small, the receive operation fails. + * + * @param buffer The buffer to write the packet to + * @param length The length of the buffer + * @param handler The handler to call when the packet has been received. If the + * handler returns true, it will be called again with the same + * buffer and maximum length when more packets have been + * received. If you want the next method in the queue to handle + * the packet received next, you need to return false from the + * method. + */ +- (void)asyncReceiveIntoBuffer: (void *)buffer + length: (size_t)length + handler: (OFSequencedPacketSocketPacketReceivedHandler) + handler; /** * @brief Asynchronously receives a packet and stores it into the specified * buffer. + * + * @deprecated Use @ref asyncReceiveIntoBuffer:length:runLoopMode:handler: + * instead. * * If the buffer is too small, the receive operation fails. * * @param buffer The buffer to write the packet to * @param length The length of the buffer @@ -256,11 +335,36 @@ * received next, you need to return false from the method. */ - (void)asyncReceiveIntoBuffer: (void *)buffer length: (size_t)length runLoopMode: (OFRunLoopMode)runLoopMode - block: (OFSequencedPacketSocketAsyncReceiveBlock)block; + block: (OFSequencedPacketSocketAsyncReceiveBlock)block + OF_DEPRECATED(ObjFW, 1, 2, + "Use -[asyncReceiveIntoBuffer:length:runLoopMode:handler:] instead"); + +/** + * @brief Asynchronously receives a packet and stores it into the specified + * buffer. + * + * If the buffer is too small, the receive operation fails. + * + * @param buffer The buffer to write the packet to + * @param length The length of the buffer + * @param runLoopMode The run loop mode in which to perform the asynchronous + * receive + * @param handler The handler to call when the packet has been received. If the + * handler returns true, it will be called again with the same + * buffer and maximum length when more packets have been + * received. If you want the next method in the queue to handle + * the packet received next, you need to return false from the + * method. + */ +- (void)asyncReceiveIntoBuffer: (void *)buffer + length: (size_t)length + runLoopMode: (OFRunLoopMode)runLoopMode + handler: (OFSequencedPacketSocketPacketReceivedHandler) + handler; #endif /** * @brief Sends the specified packet. * @@ -289,20 +393,36 @@ #ifdef OF_HAVE_BLOCKS /** * @brief Asynchronously sends the specified packet. * + * @deprecated Use @ref asyncSendData:handler: instead. + * * @param data The data to send as a packet * @param block The block to call when the packet has been sent. It should * return the data for the next send with the same callback or nil * if it should not repeat. */ - (void)asyncSendData: (OFData *)data - block: (OFSequencedPacketSocketAsyncSendDataBlock)block; + block: (OFSequencedPacketSocketAsyncSendDataBlock)block + OF_DEPRECATED(ObjFW, 1, 2, "Use -[asyncSendData:handler:] instead"); + +/** + * @brief Asynchronously sends the specified packet. + * + * @param data The data to send as a packet + * @param handler The handler to call when the packet has been sent. It should + * return the data for the next send with the same callback or + * nil if it should not repeat. + */ +- (void)asyncSendData: (OFData *)data + handler: (OFSequencedPacketSocketDataSentHandler)handler; /** * @brief Asynchronously sends the specified packet. + * + * @deprecated Use @ref asyncSendData:runLoopMode:handler: instead. * * @param data The data to send as a packet * @param runLoopMode The run loop mode in which to perform the asynchronous * send * @param block The block to call when the packet has been sent. It should @@ -309,11 +429,27 @@ * return the data for the next send with the same callback or nil * if it should not repeat. */ - (void)asyncSendData: (OFData *)data runLoopMode: (OFRunLoopMode)runLoopMode - block: (OFSequencedPacketSocketAsyncSendDataBlock)block; + block: (OFSequencedPacketSocketAsyncSendDataBlock)block + OF_DEPRECATED(ObjFW, 1, 2, + "Use -[asyncSendData:runLoopMode:handler:] instead"); + +/** + * @brief Asynchronously sends the specified packet. + * + * @param data The data to send as a packet + * @param runLoopMode The run loop mode in which to perform the asynchronous + * send + * @param handler The handler to call when the packet has been sent. It should + * return the data for the next send with the same callback or + * nil if it should not repeat. + */ +- (void)asyncSendData: (OFData *)data + runLoopMode: (OFRunLoopMode)runLoopMode + handler: (OFSequencedPacketSocketDataSentHandler)handler; #endif /** * @brief Listen on the socket. * @@ -354,29 +490,58 @@ - (void)asyncAcceptWithRunLoopMode: (OFRunLoopMode)runLoopMode; #ifdef OF_HAVE_BLOCKS /** * @brief Asynchronously accept an incoming connection. + * + * @deprecated Use @ref asyncAcceptWithHandler: instead. * * @param block The block to execute when a new connection has been accepted. * Returns whether the next incoming connection should be accepted * by the specified block as well. */ -- (void)asyncAcceptWithBlock: (OFSequencedPacketSocketAsyncAcceptBlock)block; +- (void)asyncAcceptWithBlock: (OFSequencedPacketSocketAsyncAcceptBlock)block + OF_DEPRECATED(ObjFW, 1, 2, "Use -[asyncAcceptWithHandler:] instead"); + +/** + * @brief Asynchronously accept an incoming connection. + * + * @param handler The handler to execute when a new connection has been + * accepted. Returns whether the next incoming connection + * should be accepted by the specified handler as well. + */ +- (void)asyncAcceptWithHandler: (OFSequencedPacketSocketAcceptedHandler)handler; /** * @brief Asynchronously accept an incoming connection. + * + * @deprecated Use @ref asyncAcceptWithRunLoopMode:handler: instead. * * @param runLoopMode The run loop mode in which to perform the asynchronous * accept * @param block The block to execute when a new connection has been accepted. * Returns whether the next incoming connection should be accepted * by the specified block as well. */ - (void) asyncAcceptWithRunLoopMode: (OFRunLoopMode)runLoopMode - block: (OFSequencedPacketSocketAsyncAcceptBlock)block; + block: (OFSequencedPacketSocketAsyncAcceptBlock)block + OF_DEPRECATED(ObjFW, 1, 2, + "Use -[asyncAcceptWithRunLoopMode:handler:] instead"); + +/** + * @brief Asynchronously accept an incoming connection. + * + * @param runLoopMode The run loop mode in which to perform the asynchronous + * accept + * @param handler The handler to execute when a new connection has been + * accepted. Returns whether the next incoming connection + * should be accepted by the specified handler as well. + */ +- (void) + asyncAcceptWithRunLoopMode: (OFRunLoopMode)runLoopMode + handler: (OFSequencedPacketSocketAcceptedHandler)handler; #endif /** * @brief Cancels all pending asynchronous requests on the socket. */ Index: src/OFSequencedPacketSocket.m ================================================================== --- src/OFSequencedPacketSocket.m +++ src/OFSequencedPacketSocket.m @@ -186,37 +186,75 @@ [OFRunLoop of_addAsyncReceiveForSequencedPacketSocket: self buffer: buffer length: length mode: runLoopMode # ifdef OF_HAVE_BLOCKS - block: NULL + handler: NULL # endif delegate: _delegate]; } #ifdef OF_HAVE_BLOCKS - (void)asyncReceiveIntoBuffer: (void *)buffer length: (size_t)length block: (OFSequencedPacketSocketAsyncReceiveBlock)block +{ + OFSequencedPacketSocketPacketReceivedHandler handler = ^ ( + OFSequencedPacketSocket *socket, void *buffer_, size_t length_, + id exception) { + return block(length_, exception); + }; + + [self asyncReceiveIntoBuffer: buffer + length: length + runLoopMode: OFDefaultRunLoopMode + handler: handler]; +} + +- (void)asyncReceiveIntoBuffer: (void *)buffer + length: (size_t)length + handler: (OFSequencedPacketSocketPacketReceivedHandler) + handler { [self asyncReceiveIntoBuffer: buffer length: length runLoopMode: OFDefaultRunLoopMode - block: block]; + handler: handler]; } - (void) asyncReceiveIntoBuffer: (void *)buffer length: (size_t)length runLoopMode: (OFRunLoopMode)runLoopMode block: (OFSequencedPacketSocketAsyncReceiveBlock)block +{ + OFSequencedPacketSocketPacketReceivedHandler handler = ^ ( + OFSequencedPacketSocket *socket, void *buffer_, size_t length_, + id exception) { + return block(length_, exception); + }; + + [OFRunLoop of_addAsyncReceiveForSequencedPacketSocket: self + buffer: buffer + length: length + mode: runLoopMode + handler: handler + delegate: nil]; +} + +- (void)asyncReceiveIntoBuffer: (void *)buffer + length: (size_t)length + runLoopMode: (OFRunLoopMode)runLoopMode + handler: (OFSequencedPacketSocketPacketReceivedHandler) + handler + { [OFRunLoop of_addAsyncReceiveForSequencedPacketSocket: self buffer: buffer length: length mode: runLoopMode - block: block + handler: handler delegate: nil]; } #endif - (void)sendBuffer: (const void *)buffer length: (size_t)length @@ -266,32 +304,59 @@ { [OFRunLoop of_addAsyncSendForSequencedPacketSocket: self data: data mode: runLoopMode # ifdef OF_HAVE_BLOCKS - block: NULL + handler: NULL # endif delegate: _delegate]; } #ifdef OF_HAVE_BLOCKS - (void)asyncSendData: (OFData *)data block: (OFSequencedPacketSocketAsyncSendDataBlock)block { + OFSequencedPacketSocketDataSentHandler handler = ^ ( + OFSequencedPacketSocket *socket, OFData *data_, id exception) { + return block(exception); + }; + + [self asyncSendData: data + runLoopMode: OFDefaultRunLoopMode + handler: handler]; +} + +- (void)asyncSendData: (OFData *)data + handler: (OFSequencedPacketSocketDataSentHandler)handler +{ [self asyncSendData: data runLoopMode: OFDefaultRunLoopMode - block: block]; + handler: handler]; } - (void)asyncSendData: (OFData *)data runLoopMode: (OFRunLoopMode)runLoopMode block: (OFSequencedPacketSocketAsyncSendDataBlock)block { + OFSequencedPacketSocketDataSentHandler handler = ^ ( + OFSequencedPacketSocket *socket, OFData *data_, id exception) { + return block(exception); + }; + + [self asyncSendData: data + runLoopMode: runLoopMode + handler: handler]; +} + +- (void)asyncSendData: (OFData *)data + runLoopMode: (OFRunLoopMode)runLoopMode + handler: (OFSequencedPacketSocketDataSentHandler)handler +{ [OFRunLoop of_addAsyncSendForSequencedPacketSocket: self data: data mode: runLoopMode - block: block + handler: handler delegate: nil]; } #endif - (void)listen @@ -397,27 +462,54 @@ - (void)asyncAcceptWithRunLoopMode: (OFRunLoopMode)runLoopMode { [OFRunLoop of_addAsyncAcceptForSocket: self mode: runLoopMode - block: NULL + handler: NULL delegate: _delegate]; } #ifdef OF_HAVE_BLOCKS - (void)asyncAcceptWithBlock: (OFSequencedPacketSocketAsyncAcceptBlock)block { - [self asyncAcceptWithRunLoopMode: OFDefaultRunLoopMode block: block]; + OFSequencedPacketSocketAcceptedHandler handler = ^ ( + OFSequencedPacketSocket *socket, + OFSequencedPacketSocket *acceptedSocket, id exception) { + return block(acceptedSocket, exception); + }; + + [self asyncAcceptWithRunLoopMode: OFDefaultRunLoopMode + handler: handler]; +} + +- (void)asyncAcceptWithHandler: (OFSequencedPacketSocketAcceptedHandler)handler +{ + [self asyncAcceptWithRunLoopMode: OFDefaultRunLoopMode + handler: handler]; } - (void) asyncAcceptWithRunLoopMode: (OFRunLoopMode)runLoopMode block: (OFSequencedPacketSocketAsyncAcceptBlock)block { + OFSequencedPacketSocketAcceptedHandler handler = ^ ( + OFSequencedPacketSocket *socket, + OFSequencedPacketSocket *acceptedSocket, id exception) { + return block(acceptedSocket, exception); + }; + + [self asyncAcceptWithRunLoopMode: runLoopMode + handler: handler]; +} + +- (void) + asyncAcceptWithRunLoopMode: (OFRunLoopMode)runLoopMode + handler: (OFSequencedPacketSocketAcceptedHandler)handler +{ [OFRunLoop of_addAsyncAcceptForSocket: self mode: runLoopMode - block: block + handler: handler delegate: nil]; } #endif - (const OFSocketAddress *)remoteAddress Index: src/OFStreamSocket.m ================================================================== --- src/OFStreamSocket.m +++ src/OFStreamSocket.m @@ -331,11 +331,11 @@ - (void)asyncAcceptWithRunLoopMode: (OFRunLoopMode)runLoopMode { [OFRunLoop of_addAsyncAcceptForSocket: self mode: runLoopMode - block: NULL + handler: NULL delegate: _delegate]; } #ifdef OF_HAVE_BLOCKS - (void)asyncAcceptWithBlock: (OFStreamSocketAsyncAcceptBlock)block @@ -346,11 +346,11 @@ - (void)asyncAcceptWithRunLoopMode: (OFRunLoopMode)runLoopMode block: (OFStreamSocketAsyncAcceptBlock)block { [OFRunLoop of_addAsyncAcceptForSocket: self mode: runLoopMode - block: block + handler: block delegate: nil]; } #endif - (const OFSocketAddress *)remoteAddress