ObjFW
OFSPXStreamSocket.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008-2024 Jonathan Schleifer <js@nil.im>
3  *
4  * All rights reserved.
5  *
6  * This file is part of ObjFW. It may be distributed under the terms of the
7  * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
8  * the packaging of this file.
9  *
10  * Alternatively, it may be distributed under the terms of the GNU General
11  * Public License, either version 2 or 3, which can be found in the file
12  * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
13  * file.
14  */
15 
16 #import "OFStreamSocket.h"
17 #import "OFRunLoop.h"
18 
19 OF_ASSUME_NONNULL_BEGIN
20 
23 @class OFSPXStreamSocket;
24 @class OFString;
25 
26 #ifdef OF_HAVE_BLOCKS
33 typedef void (^OFSPXStreamSocketAsyncConnectBlock)(id _Nullable exception);
34 #endif
35 
43 @optional
54 - (void)socket: (OFSPXStreamSocket *)socket
55  didConnectToNetwork: (uint32_t)network
56  node: (const unsigned char [_Nonnull IPX_NODE_LEN])node
57  port: (uint16_t)port
58  exception: (nullable id)exception;
59 @end
60 
73 {
74  OF_RESERVE_IVARS(OFSPXStreamSocket, 4)
75 }
76 
83 @property OF_NULLABLE_PROPERTY (assign, nonatomic)
85 
96 - (void)connectToNetwork: (uint32_t)network
97  node: (const unsigned char [_Nonnull IPX_NODE_LEN])node
98  port: (uint16_t)port;
99 
109 - (void)asyncConnectToNetwork: (uint32_t)network
110  node: (const unsigned char [_Nonnull IPX_NODE_LEN])node
111  port: (uint16_t)port;
112 
124 - (void)asyncConnectToNetwork: (uint32_t)network
125  node: (const unsigned char [_Nonnull IPX_NODE_LEN])node
126  port: (uint16_t)port
127  runLoopMode: (OFRunLoopMode)runLoopMode;
128 
129 #ifdef OF_HAVE_BLOCKS
140 - (void)asyncConnectToNetwork: (uint32_t)network
141  node: (const unsigned char [_Nonnull IPX_NODE_LEN])node
142  port: (uint16_t)port
144 
157 - (void)asyncConnectToNetwork: (uint32_t)network
158  node: (const unsigned char [_Nonnull IPX_NODE_LEN])node
159  port: (uint16_t)port
160  runLoopMode: (OFRunLoopMode)runLoopMode
162 #endif
163 
176 - (OFSocketAddress)
177  bindToNetwork: (uint32_t)network
178  node: (const unsigned char [_Nonnull IPX_NODE_LEN])node
179  port: (uint16_t)port;
180 @end
181 
182 OF_ASSUME_NONNULL_END
void(^ OFSPXStreamSocketAsyncConnectBlock)(id exception)
A block which is called when the socket connected.
Definition: OFSPXStreamSocket.h:33
A class for storing constant strings using the @"" literal.
Definition: OFConstantString.h:38
A class which provides methods to create and use SPX stream sockets.
Definition: OFSPXStreamSocket.h:73
A class which provides methods to create and use stream sockets.
Definition: OFStreamSocket.h:68
A class for handling strings.
Definition: OFString.h:135
Definition: OFSPXStreamSocket.h:42
Definition: OFStreamSocket.h:44
A struct which represents a host / port pair for a socket.
Definition: OFSocket.h:182