ObjFW
Loading...
Searching...
No Matches
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 program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License version 3.0 only,
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13 * version 3.0 for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * version 3.0 along with this program. If not, see
17 * <https://www.gnu.org/licenses/>.
18 */
19
20#import "OFStreamSocket.h"
21#import "OFRunLoop.h"
22
23OF_ASSUME_NONNULL_BEGIN
24
28@class OFString;
29
30#ifdef OF_HAVE_BLOCKS
37typedef void (^OFSPXStreamSocketAsyncConnectBlock)(id _Nullable exception);
38#endif
39
46@protocol OFSPXStreamSocketDelegate <OFStreamSocketDelegate>
47@optional
58- (void)socket: (OFSPXStreamSocket *)socket
59 didConnectToNetwork: (uint32_t)network
60 node: (const unsigned char [_Nonnull IPX_NODE_LEN])node
61 port: (uint16_t)port
62 exception: (nullable id)exception;
63@end
64
77{
78 OF_RESERVE_IVARS(OFSPXStreamSocket, 4)
79}
80
87@property OF_NULLABLE_PROPERTY (assign, nonatomic)
88 id <OFSPXStreamSocketDelegate> delegate;
89
100- (void)connectToNetwork: (uint32_t)network
101 node: (const unsigned char [_Nonnull IPX_NODE_LEN])node
102 port: (uint16_t)port;
103
113- (void)asyncConnectToNetwork: (uint32_t)network
114 node: (const unsigned char [_Nonnull IPX_NODE_LEN])node
115 port: (uint16_t)port;
116
128- (void)asyncConnectToNetwork: (uint32_t)network
129 node: (const unsigned char [_Nonnull IPX_NODE_LEN])node
130 port: (uint16_t)port
131 runLoopMode: (OFRunLoopMode)runLoopMode;
132
133#ifdef OF_HAVE_BLOCKS
144- (void)asyncConnectToNetwork: (uint32_t)network
145 node: (const unsigned char [_Nonnull IPX_NODE_LEN])node
146 port: (uint16_t)port
148
161- (void)asyncConnectToNetwork: (uint32_t)network
162 node: (const unsigned char [_Nonnull IPX_NODE_LEN])node
163 port: (uint16_t)port
164 runLoopMode: (OFRunLoopMode)runLoopMode
166#endif
167
181 bindToNetwork: (uint32_t)network
182 node: (const unsigned char [_Nonnull IPX_NODE_LEN])node
183 port: (uint16_t)port;
184@end
185
186OF_ASSUME_NONNULL_END
void(^ OFSPXStreamSocketAsyncConnectBlock)(id exception)
A block which is called when the socket connected.
Definition OFSPXStreamSocket.h:37
A class for storing constant strings using the @"" literal.
Definition OFConstantString.h:42
A class which provides methods to create and use SPX stream sockets.
Definition OFSPXStreamSocket.h:77
A class which provides methods to create and use stream sockets.
Definition OFStreamSocket.h:72
A class for handling strings.
Definition OFString.h:139
A struct which represents a host / port pair for a socket.
Definition OFSocket.h:186