ObjFW
OFSPXStreamSocket.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008-2021 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
34  id _Nullable exception);
35 #endif
36 
44 @optional
55 - (void)socket: (OFSPXStreamSocket *)socket
56  didConnectToNode: (unsigned char [_Nonnull IPX_NODE_LEN])node
57  network: (uint32_t)network
58  port: (uint16_t)port
59  exception: (nullable id)exception;
60 @end
61 
74 {
75  OF_RESERVE_IVARS(OFSPXStreamSocket, 4)
76 }
77 
84 @property OF_NULLABLE_PROPERTY (assign, nonatomic)
86 
95 - (void)connectToNode: (unsigned char [_Nonnull IPX_NODE_LEN])node
96  network: (uint32_t)network
97  port: (uint16_t)port;
98 
108 - (void)asyncConnectToNode: (unsigned char [_Nonnull IPX_NODE_LEN])node
109  network: (uint32_t)network
110  port: (uint16_t)port;
111 
122 - (void)asyncConnectToNode: (unsigned char [_Nonnull IPX_NODE_LEN])node
123  network: (uint32_t)network
124  port: (uint16_t)port
125  runLoopMode: (of_run_loop_mode_t)runLoopMode;
126 
127 #ifdef OF_HAVE_BLOCKS
138 - (void)asyncConnectToNode: (unsigned char [_Nonnull IPX_NODE_LEN])node
139  network: (uint32_t)network
140  port: (uint16_t)port
142 
154 - (void)asyncConnectToNode: (unsigned char [_Nonnull IPX_NODE_LEN])node
155  network: (uint32_t)network
156  port: (uint16_t)port
157  runLoopMode: (of_run_loop_mode_t)runLoopMode
159 #endif
160 
168 - (of_socket_address_t)bindToPort: (uint16_t)port;
169 @end
170 
171 OF_ASSUME_NONNULL_END
void(^ of_spx_stream_socket_async_connect_block_t)(id _Nullable exception)
A block which is called when the socket connected.
Definition: OFSPXStreamSocket.h:33
struct objc_object * id
A pointer to any object.
Definition: ObjFWRT.h:90
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:74
A class which provides methods to create and use stream sockets.
Definition: OFStreamSocket.h:69
A class for handling strings.
Definition: OFString.h:132
Definition: OFSPXStreamSocket.h:43
Definition: OFStreamSocket.h:45
A struct which represents a host / port pair for a socket.
Definition: socket.h:136