1
2
3
4
5
6
7
8
9
|
/*
* Copyright (c) 2008-2022 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.
*
|
|
|
1
2
3
4
5
6
7
8
9
|
/*
* Copyright (c) 2008-2023 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.
*
|
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
{
void *pool = objc_autoreleasePoolPush();
OFString *path;
OFUNIXStreamSocket *sockClient, *sockServer, *sockAccepted;
char buffer[5];
#if defined(OF_HAVE_FILES) && !defined(OF_IOS)
path = [[OFSystemInfo temporaryDirectoryURI]
URIByAppendingPathComponent: [[OFUUID UUID] UUIDString]]
.fileSystemRepresentation;
#else
/*
* We can have sockets, including UNIX sockets, while file support is
* disabled.
*
* We also use this code path for iOS, as the temporaryDirectoryURI is
* too long on the iOS simulator.
*/
path = [OFString stringWithFormat: @"/tmp/%@",
[[OFUUID UUID] UUIDString]];
#endif
TEST(@"+[socket]", (sockClient = [OFUNIXStreamSocket socket]) &&
|
|
|
|
|
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
{
void *pool = objc_autoreleasePoolPush();
OFString *path;
OFUNIXStreamSocket *sockClient, *sockServer, *sockAccepted;
char buffer[5];
#if defined(OF_HAVE_FILES) && !defined(OF_IOS)
path = [[OFSystemInfo temporaryDirectoryIRI]
IRIByAppendingPathComponent: [[OFUUID UUID] UUIDString]]
.fileSystemRepresentation;
#else
/*
* We can have sockets, including UNIX sockets, while file support is
* disabled.
*
* We also use this code path for iOS, as the temporaryDirectory:RI is
* too long on the iOS simulator.
*/
path = [OFString stringWithFormat: @"/tmp/%@",
[[OFUUID UUID] UUIDString]];
#endif
TEST(@"+[socket]", (sockClient = [OFUNIXStreamSocket socket]) &&
|