Differences From Artifact [fee5d55648]:
- File
src/OFTCPSocket.h
— 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: 7018) [annotate] [blame] [check-ins using]
To Artifact [b417a8af49]:
- File src/OFTCPSocket.h — part of check-in [7908c035e4] at 2014-01-30 12:26:19 on branch trunk — Rename of_tcpsocket* -> of_tcp_socket_* (user: js, size: 7022) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
27 28 29 30 31 32 33 | /*! * @brief A block which is called when the socket connected. * * @param socket The socket which connected * @param exception An exception which occurred while connecting the socket or * nil on success */ | | | | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | /*! * @brief A block which is called when the socket connected. * * @param socket The socket which connected * @param exception An exception which occurred while connecting the socket or * nil on success */ typedef void (^of_tcp_socket_async_connect_block_t)(OFTCPSocket *socket, OFException *exception); /*! * @brief A block 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 block should be used for the next incoming * connection */ typedef bool (^of_tcp_socket_async_accept_block_t)(OFTCPSocket *socket, OFTCPSocket *acceptedSocket, OFException *exception); #endif /*! * @brief A class which provides functions to create and use TCP sockets. * * To connect to a server, create a socket and connect it. |
︙ | ︙ | |||
159 160 161 162 163 164 165 | * * @param host The host to connect to * @param port The port on the host to connect to * @param block The block to execute once the connection has been established */ - (void)asyncConnectToHost: (OFString*)host port: (uint16_t)port | | | 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | * * @param host The host to connect to * @param port The port on the host to connect to * @param block The block to execute once the connection has been established */ - (void)asyncConnectToHost: (OFString*)host port: (uint16_t)port block: (of_tcp_socket_async_connect_block_t)block; # endif #endif /*! * @brief Bind the socket to the specified host and port. * * @param host The host to bind to. Use `@"0.0.0.0"` for IPv4 or `@"::"` for |
︙ | ︙ | |||
216 217 218 219 220 221 222 | /*! * @brief Asyncronously accept an incoming connection. * * @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. */ | | | 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | /*! * @brief Asyncronously accept an incoming connection. * * @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: (of_tcp_socket_async_accept_block_t)block; #endif /*! * @brief Enable or disable keep alives for the connection. * * @param enable Whether to enable or disable keep alives for the connection */ |
︙ | ︙ |