19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
-
+
|
#import "OFSPXStreamSocket.h"
#import "OFRunLoop.h"
#import "OFRunLoop+Private.h"
#import "OFSocket.h"
#import "OFSocket+Private.h"
#import "OFAlreadyConnectedException.h"
#import "OFAlreadyOpenException.h"
#import "OFBindIPXSocketFailedException.h"
#import "OFConnectSPXSocketFailedException.h"
#import "OFNotOpenException.h"
#ifndef NSPROTO_SPX
# define NSPROTO_SPX 0
#endif
|
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
|
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
|
-
+
|
errNo: (int *)errNo
{
#if SOCK_CLOEXEC == 0 && defined(HAVE_FCNTL) && defined(FD_CLOEXEC)
int flags;
#endif
if (_socket != OFInvalidSocketHandle)
@throw [OFAlreadyConnectedException exceptionWithSocket: self];
@throw [OFAlreadyOpenException exceptionWithObject: self];
if ((_socket = socket(address->sockaddr.ipx.sipx_family,
SOCK_STREAM | SOCK_CLOEXEC, NSPROTO_SPX)) ==
OFInvalidSocketHandle) {
*errNo = OFSocketErrNo();
return false;
}
|
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
|
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
|
-
+
|
{
OFSocketAddress address;
#if SOCK_CLOEXEC == 0 && defined(HAVE_FCNTL_H) && defined(FD_CLOEXEC)
int flags;
#endif
if (_socket != OFInvalidSocketHandle)
@throw [OFAlreadyConnectedException exceptionWithSocket: self];
@throw [OFAlreadyOpenException exceptionWithObject: self];
address = OFSocketAddressMakeIPX(network, node, port);
if ((_socket = socket(address.sockaddr.ipx.sipx_family,
SOCK_STREAM | SOCK_CLOEXEC, NSPROTO_SPX)) == OFInvalidSocketHandle)
@throw [OFBindIPXSocketFailedException
exceptionWithNetwork: network
|