ObjFW
Loading...
Searching...
No Matches
OFSPXSocket.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008-2023 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
17#import "OFRunLoop.h"
18
19OF_ASSUME_NONNULL_BEGIN
20
23@class OFSPXSocket;
24@class OFString;
25
26#ifdef OF_HAVE_BLOCKS
33typedef void (^OFSPXSocketAsyncConnectBlock)(id _Nullable exception);
34#endif
35
41@protocol OFSPXSocketDelegate <OFSequencedPacketSocketDelegate>
42@optional
53- (void)socket: (OFSPXSocket *)socket
54 didConnectToNetwork: (uint32_t)network
55 node: (const unsigned char [_Nonnull IPX_NODE_LEN])node
56 port: (uint16_t)port
57 exception: (nullable id)exception;
58@end
59
72{
73 OF_RESERVE_IVARS(OFSPXSocket, 4)
74}
75
82@property OF_NULLABLE_PROPERTY (assign, nonatomic)
83 id <OFSPXSocketDelegate> delegate;
84
95- (void)connectToNetwork: (uint32_t)network
96 node: (const unsigned char [_Nonnull IPX_NODE_LEN])node
97 port: (uint16_t)port;
98
107- (void)asyncConnectToNetwork: (uint32_t)network
108 node: (const unsigned char [_Nonnull IPX_NODE_LEN])node
109 port: (uint16_t)port;
110
120- (void)asyncConnectToNetwork: (uint32_t)network
121 node: (const unsigned char [_Nonnull IPX_NODE_LEN])node
122 port: (uint16_t)port
123 runLoopMode: (OFRunLoopMode)runLoopMode;
124
125#ifdef OF_HAVE_BLOCKS
135- (void)asyncConnectToNetwork: (uint32_t)network
136 node: (const unsigned char [_Nonnull IPX_NODE_LEN])node
137 port: (uint16_t)port
138 block: (OFSPXSocketAsyncConnectBlock)block;
139
150- (void)asyncConnectToNetwork: (uint32_t)network
151 node: (const unsigned char [_Nonnull IPX_NODE_LEN])node
152 port: (uint16_t)port
153 runLoopMode: (OFRunLoopMode)runLoopMode
154 block: (OFSPXSocketAsyncConnectBlock)block;
155#endif
156
170 bindToNetwork: (uint32_t)network
171 node: (const unsigned char [_Nonnull IPX_NODE_LEN])node
172 port: (uint16_t)port;
173@end
174
175OF_ASSUME_NONNULL_END
void(^ OFSPXSocketAsyncConnectBlock)(id exception)
A block which is called when the socket connected.
Definition: OFSPXSocket.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 sockets.
Definition: OFSPXSocket.h:72
A base class for sequenced packet sockets.
Definition: OFSequencedPacketSocket.h:128
A class for handling strings.
Definition: OFString.h:135
A struct which represents a host / port pair for a socket.
Definition: OFSocket.h:182