@@ -10,34 +10,40 @@ */ #import "OFObject.h" @class OFSocket; +@class OFTCPSocket; @class OFDataArray; @class OFMutableDictionary; /** * \brief A protocol that needs to be implemented by delegates for * OFSocketObserver. */ @protocol OFSocketObserverDelegate +/* + * This callback is called when a listening socket got a new incoming + * connection. + * + * \param sock The socket which did receive an incoming connection + */ +- (void)socketDidReceiveIncomingConnection: (OFTCPSocket*)sock; + /** * This callback is called when a socket did get ready for reading. * - * This callback is also called when a listening socket got a new incoming - * connection. - * - * \param sock The socket which did get ready for reading + * \param sock The socket which did become ready for reading */ -- (void)socketDidGetReadyForReading: (OFSocket*)sock; +- (void)socketDidBecomeReadyForReading: (OFSocket*)sock; /** * This callback is called when a socket did get ready for writing. * - * \param sock The socket which did get ready for writing + * \param sock The socket which did become ready for writing */ -- (void)socketDidGetReadyForWriting: (OFSocket*)sock; +- (void)socketDidBecomeReadyForWriting: (OFSocket*)sock; @end /** * \brief A class that can observe multiple sockets at once. */ @@ -67,10 +73,17 @@ * * \param delegate The delegate for the OFSocketObserver */ - (void)setDelegate: (OFObject *)delegate; +/** + * Adds a socket to observe for incoming connections. + * + * \param sock The socket to observe for incoming connections + */ +- (void)addSocketToObserveForIncomingConnections: (OFTCPSocket*)sock; + /** * Adds a socket to observe for reading. * * \param sock The socket to observe for reading */ @@ -81,10 +94,17 @@ * * \param sock The socket to observe for writing */ - (void)addSocketToObserveForWriting: (OFSocket*)sock; +/** + * Removes a socket to observe for incoming connections. + * + * \param sock The socket to remove from observing for incoming connections + */ +- (void)removeSocketToObserveForIncomingConnections: (OFTCPSocket*)sock; + /** * Removes a socket to observe for reading. * * \param sock The socket to remove from observing for reading */