ObjFW  Diff

Differences From Artifact [d27684139a]:

To Artifact [4b861449bf]:

  • File src/OFTCPSocket.h — part of check-in [81d47f4398] at 2014-01-25 19:33:57 on branch trunk — Move socket includes and helpers to separate files

    The new file socket.h includes all headers required for sockets on the
    used platform, while the file socket_helpers.h defines the BSD API
    functions to the platform specific functions if necessary.

    This cleans up the classes dealing with sockets a lot and also reduces
    code duplication. (user: js, size: 7020) [annotate] [blame] [check-ins using]


10
11
12
13
14
15
16
17
18
19
20
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
10
11
12
13
14
15
16













17
18




19





20
21
22
23
24
25
26







-
-
-
-
-
-
-
-
-
-
-
-
-


-
-
-
-
+
-
-
-
-
-







 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS
#endif
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif

#import "objfw-defs.h"

#ifdef OF_HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif

#import "OFStreamSocket.h"

#ifdef _WIN32
# include <ws2tcpip.h>
#endif

#import "socket.h"
#ifdef __wii__
# define BOOL OGC_BOOL
# include <network.h>
# undef BOOL
#endif

/*! @file */

@class OFTCPSocket;
@class OFString;

#ifdef OF_HAVE_BLOCKS
74
75
76
77
78
79
80
81

82
83
84
85
86
87
88
53
54
55
56
57
58
59

60
61
62
63
64
65
66
67







-
+







 *
 * 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
{
	bool _listening;
	struct sockaddr_storage *_sockAddr;
	struct sockaddr_storage _sockAddr;
	socklen_t _sockAddrLen;
	OFString *_SOCKS5Host;
	uint16_t _SOCKS5Port;
}

#ifdef OF_HAVE_PROPERTIES
@property (readonly, getter=isListening) bool listening;