ObjFW  Diff

Differences From Artifact [cd657843ce]:

To Artifact [facc710023]:


33
34
35
36
37
38
39
40
41



42
43
44
45
46
47
48
33
34
35
36
37
38
39


40
41
42
43
44
45
46
47
48
49







-
-
+
+
+







# include <ws2tcpip.h>
#endif

@class OFTCPSocket;
@class OFString;

#ifdef OF_HAVE_BLOCKS
typedef void (^of_tcpsocket_async_connect_block_t)(OFTCPSocket*);
typedef BOOL (^of_tcpsocket_async_accept_block_t)(OFTCPSocket*, OFTCPSocket*);
typedef void (^of_tcpsocket_async_connect_block_t)(OFTCPSocket*, OFException*);
typedef BOOL (^of_tcpsocket_async_accept_block_t)(OFTCPSocket*, OFTCPSocket*,
    OFException*);
#endif

/**
 * \brief A class which provides functions to create and use TCP sockets.
 *
 * To connect to a server, create a socket and connect it.
 * To create a server, create a socket, bind it and listen on it.
133
134
135
136
137
138
139
140

141
142
143
144
145
146
147
134
135
136
137
138
139
140

141
142
143
144
145
146
147
148







-
+







 * \brief Asyncronously connect the OFTCPSocket to the specified destination.
 *
 * \param host The host to connect to
 * \param port The port on the host to connect to
 * \param target The target on which to call the selector once the connection
 *		 has been established
 * \param selector The selector to call on the target. The signature must be
 *		   void (OFTCPSocket *socket).
 *		   void (OFTCPSocket *socket, OFException *exception).
 */
- (void)asyncConnectToHost: (OFString*)host
		      port: (uint16_t)port
		    target: (id)target
		  selector: (SEL)selector;

#ifdef OF_HAVE_BLOCKS
192
193
194
195
196
197
198
199


200
201
202
203
204
205
206
193
194
195
196
197
198
199

200
201
202
203
204
205
206
207
208







-
+
+







 * \brief Asyncronously ccept an incoming connection.
 *
 * \param target The target on which to execute the selector when a new
 *		 connection has been accepted. The method returns whether the
 *		 next incoming connection should be accepted by the specified
 *		 block as well.
 * \param selector The selector to call on the target. The signature must be
 *		   BOOL (OFTCPSocket *socket, OFTCPSocket *acceptedSocket).
 *		   BOOL (OFTCPSocket *socket, OFTCPSocket *acceptedSocket,
 *		   OFException *exception).
 */
- (void)asyncAcceptWithTarget: (id)target
		     selector: (SEL)selector;

#ifdef OF_HAVE_BLOCKS
/**
 * \brief Asyncronously ccept an incoming connection.