Overview
Context
Changes
Modified src/Makefile
from [651753ff6c]
to [bcf342d5bf].
︙ | | |
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
|
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
-
+
+
|
OFTCPSocket.m \
OFUDPSocket.m \
${USE_SRCS_IPX} \
${USE_SRCS_UNIX_SOCKETS}
SRCS_IPX = OFIPXSocket.m \
OFSPXSocket.m \
OFSPXStreamSocket.m
SRCS_UNIX_SOCKETS = OFUNIXDatagramSocket.m
SRCS_UNIX_SOCKETS = OFUNIXDatagramSocket.m \
OFUNIXStreamSocket.m
SRCS_THREADS = OFCondition.m \
OFMutex.m \
OFPlainCondition.m \
OFPlainMutex.m \
OFPlainThread.m \
OFRecursiveMutex.m \
OFTLSKey.m \
|
︙ | | |
Modified src/OFStreamSocket.m
from [5b9cb9181f]
to [79180ccd72].
︙ | | |
295
296
297
298
299
300
301
302
303
304
305
306
307
308
|
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
|
+
+
+
+
+
|
client->_remoteAddress.family = OFSocketAddressFamilyIPv6;
break;
#endif
#ifdef OF_HAVE_IPX
case AF_IPX:
client->_remoteAddress.family = OFSocketAddressFamilyIPX;
break;
#endif
#ifdef OF_HAVE_UNIX_SOCKETS
case AF_UNIX:
client->_remoteAddress.family = OFSocketAddressFamilyUNIX;
break;
#endif
default:
client->_remoteAddress.family = OFSocketAddressFamilyUnknown;
break;
}
return client;
|
︙ | | |
Modified src/OFTCPSocket.h
from [9ae8ba1677]
to [7942720881].
︙ | | |
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
|
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
|
-
+
-
+
-
+
-
+
-
+
-
+
|
* @brief Returns the port to use as a SOCKS5 proxy when creating a new socket
*
* @return The port to use as a SOCKS5 proxy when creating a new socket
*/
+ (uint16_t)SOCKS5Port;
/**
* @brief Connect the OFTCPSocket to the specified destination.
* @brief Connects the OFTCPSocket to the specified destination.
*
* @param host The host to connect to
* @param port The port on the host to connect to
*/
- (void)connectToHost: (OFString *)host port: (uint16_t)port;
/**
* @brief Asynchronously connect the OFTCPSocket to the specified destination.
* @brief Asynchronously connects the OFTCPSocket to the specified destination.
*
* @param host The host to connect to
* @param port The port on the host to connect to
*/
- (void)asyncConnectToHost: (OFString *)host port: (uint16_t)port;
/**
* @brief Asynchronously connect the OFTCPSocket to the specified destination.
* @brief Asynchronously connects the OFTCPSocket to the specified destination.
*
* @param host The host to connect to
* @param port The port on the host to connect to
* @param runLoopMode The run loop mode in which to perform the async connect
*/
- (void)asyncConnectToHost: (OFString *)host
port: (uint16_t)port
runLoopMode: (OFRunLoopMode)runLoopMode;
#ifdef OF_HAVE_BLOCKS
/**
* @brief Asynchronously connect the OFTCPSocket to the specified destination.
* @brief Asynchronously connects the OFTCPSocket to the specified destination.
*
* @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: (OFTCPSocketAsyncConnectBlock)block;
/**
* @brief Asynchronously connect the OFTCPSocket to the specified destination.
* @brief Asynchronously connects the OFTCPSocket to the specified destination.
*
* @param host The host to connect to
* @param port The port on the host to connect to
* @param runLoopMode The run loop mode in which to perform the async connect
* @param block The block to execute once the connection has been established
*/
- (void)asyncConnectToHost: (OFString *)host
port: (uint16_t)port
runLoopMode: (OFRunLoopMode)runLoopMode
block: (OFTCPSocketAsyncConnectBlock)block;
#endif
/**
* @brief Bind the socket to the specified host and port.
* @brief Binds the socket to the specified host and port.
*
* @param host The host to bind to. Use `@"0.0.0.0"` for IPv4 or `@"::"` for
* IPv6 to bind to all.
* @param port The port to bind to. If the port is 0, an unused port will be
* chosen, which can be obtained using the return value.
* @return The port the socket was bound to
*/
|
︙ | | |
Modified src/OFUNIXDatagramSocket.m
from [44180adae5]
to [b4a4c54b03].
︙ | | |
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
+
|
#ifdef HAVE_FCNTL_H
# include <fcntl.h>
#endif
#import "OFUNIXDatagramSocket.h"
#import "OFSocket.h"
#import "OFSocket+Private.h"
#import "OFString.h"
#import "OFAlreadyConnectedException.h"
#import "OFBindFailedException.h"
@implementation OFUNIXDatagramSocket
@dynamic delegate;
|
︙ | | |
Added src/OFUNIXStreamSocket.h version [75f2f4081c].
|
1
2
3
4
5
6
7
8
9
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
/*
* Copyright (c) 2008-2021 Jonathan Schleifer <js@nil.im>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
* 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.
*/
#import "OFStreamSocket.h"
OF_ASSUME_NONNULL_BEGIN
@class OFString;
/**
* @protocol OFUNIXStreamSocketDelegate OFUNIXStreamSocket.h \
* ObjFW/OFUNIXStreamSocket.h
*
* A delegate for OFUNIXStreamSocket.
*/
@protocol OFUNIXStreamSocketDelegate <OFStreamSocketDelegate>
@end
/**
* @class OFUNIXStreamSocket OFUNIXStreamSocket.h ObjFW/OFUNIXStreamSocket.h
*
* @brief A class which provides methods to create and use UNIX stream 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 OFUNIXStreamSocket: OFStreamSocket
{
OF_RESERVE_IVARS(OFUNIXStreamSocket, 4)
}
/**
* @brief The delegate for asynchronous operations on the socket.
*
* @note The delegate is retained for as long as asynchronous operations are
* still ongoing.
*/
@property OF_NULLABLE_PROPERTY (assign, nonatomic)
id <OFUNIXStreamSocketDelegate> delegate;
/**
* @brief Connects the OFUNIXStreamSocket to the specified destination.
*
* @param path The path to connect to
*/
- (void)connectToPath: (OFString *)path;
/**
* @brief Binds the socket to the specified host and port.
*
* @param path The path to bind to
*/
- (void)bindToPath: (OFString *)path;
@end
OF_ASSUME_NONNULL_END
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Added src/OFUNIXStreamSocket.m version [14bddbd499].