ObjFW  Diff

Differences From Artifact [b07d89367b]:

To Artifact [64acad46b9]:


21
22
23
24
25
26
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
55
# include <ws2tcpip.h>
#endif

@class OFString;

/**
 * \brief A class which provides functions to create and use TCP sockets.



 */
@interface OFTCPSocket: OFStreamSocket
{
	struct sockaddr	*sockAddr;
	socklen_t	sockAddrLen;
}

/**
 * Connect the OFTCPSocket to the specified destination.
 *
 * \param service The service on the node to connect to
 * \param node The node to connect to
 */
- (void)connectToService: (OFString*)service
		  onNode: (OFString*)node;

/**
 * Bind socket on the specified node and service.
 *
 * \param service The service to bind
 * \param node The node to bind to

 * \param family The family to use (AF_INET for IPv4 or AF_INET6 for IPv6)
 */
- (void)bindService: (OFString*)service
	     onNode: (OFString*)node
	 withFamily: (int)family;

/**







>
>
>




















|
>







21
22
23
24
25
26
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
55
56
57
58
59
# include <ws2tcpip.h>
#endif

@class OFString;

/**
 * \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.
 */
@interface OFTCPSocket: OFStreamSocket
{
	struct sockaddr	*sockAddr;
	socklen_t	sockAddrLen;
}

/**
 * Connect the OFTCPSocket to the specified destination.
 *
 * \param service The service on the node to connect to
 * \param node The node to connect to
 */
- (void)connectToService: (OFString*)service
		  onNode: (OFString*)node;

/**
 * Bind socket on the specified node and service.
 *
 * \param service The service to bind
 * \param node The node to bind to. Use @"0.0.0.0" for IPv4 or @"::" for IPv6
 *	       to bind to all.
 * \param family The family to use (AF_INET for IPv4 or AF_INET6 for IPv6)
 */
- (void)bindService: (OFString*)service
	     onNode: (OFString*)node
	 withFamily: (int)family;

/**