ObjFW  Diff

Differences From Artifact [f57aab987d]:

To Artifact [4bb1b2f501]:


21
22
23
24
25
26
27
28

29
30
31
32
33
34
35
21
22
23
24
25
26
27

28
29
30
31
32
33
34
35







-
+







#import "OFRunLoop.h"
#import "OFRunLoop+Private.h"
#import "OFSocket.h"
#import "OFSocket+Private.h"

#import "OFAlreadyConnectedException.h"
#import "OFBindIPXSocketFailedException.h"
#import "OFConnectSocketFailedException.h"
#import "OFConnectSPXSocketFailedException.h"
#import "OFNotOpenException.h"

#ifndef NSPROTO_SPX
# define NSPROTO_SPX 0
#endif

static const uint8_t SPXPacketType = 5;
162
163
164
165
166
167
168
169
170
171
172
173





174
175
176
177
178
179
180
162
163
164
165
166
167
168





169
170
171
172
173
174
175
176
177
178
179
180







-
-
-
-
-
+
+
+
+
+







#ifdef OF_HAVE_BLOCKS
	}
#endif
}

- (id)of_connectionFailedExceptionForErrNo: (int)errNo
{
	return [OFConnectSocketFailedException exceptionWithNetwork: _network
							       node: _node
							       port: _port
							     socket: _socket
							      errNo: errNo];
	return [OFConnectSPXSocketFailedException exceptionWithNetwork: _network
								  node: _node
								  port: _port
								socket: _socket
								 errNo: errNo];
}
@end

@implementation OFSPXSocket
@dynamic delegate;

- (int)of_createSocketForAddress: (const OFSocketAddress *)address
227
228
229
230
231
232
233
234

235
236
237
238
239
240
241
242
243
244

245
246
247
248
249
250
251
227
228
229
230
231
232
233

234
235
236
237
238
239
240
241
242
243

244
245
246
247
248
249
250
251







-
+









-
+







		    node: (const unsigned char [IPX_NODE_LEN])node
		    port: (uint16_t)port
{
	OFSocketAddress address = OFSocketAddressMakeIPX(network, node, port);
	int errNo;

	if (![self of_createSocketForAddress: &address errNo: &errNo])
		@throw [OFConnectSocketFailedException
		@throw [OFConnectSPXSocketFailedException
		    exceptionWithNetwork: network
				    node: node
				    port: port
				  socket: self
				   errNo: errNo];

	if (![self of_connectSocketToAddress: &address errNo: &errNo]) {
		[self of_closeSocket];

		@throw [OFConnectSocketFailedException
		@throw [OFConnectSPXSocketFailedException
		    exceptionWithNetwork: network
				    node: node
				    port: port
				  socket: self
				   errNo: errNo];
	}
}