Differences From Artifact [26e1e49cc2]:
- File src/OFSPXSocket.h — part of check-in [e3c5bb70dd] at 2021-04-17 13:58:44 on branch new-naming-convention — of_socket_address_t -> OFSocketAddress (user: js, size: 5422) [annotate] [blame] [check-ins using] [more...]
To Artifact [4d2a1f1863]:
- File
src/OFSPXSocket.h
— part of check-in
[ccc6a77c55]
at
2022-08-06 14:43:01
on branch trunk
— Reorder node and network of IPX sockets
This is more standard, albeit -[connectToNetwork:node:port:] sounding a
little bit more like you connect to a network rather than a node. (user: js, size: 5383) [annotate] [blame] [check-ins using] [more...]
1 | /* | | | 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. * |
︙ | ︙ | |||
40 41 42 43 44 45 46 | */ @protocol OFSPXSocketDelegate <OFSequencedPacketSocketDelegate> @optional /** * @brief A method which is called when a socket connected. * * @param socket The socket which connected | < > | > | < | | | 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | */ @protocol OFSPXSocketDelegate <OFSequencedPacketSocketDelegate> @optional /** * @brief A method which is called when a socket connected. * * @param socket The socket which connected * @param network The network of the node the socket connected to * @param node The node the socket connected to * @param port The port of the node to which the socket connected * @param exception An exception that occurred while connecting, or nil on * success */ - (void)socket: (OFSPXSocket *)socket didConnectToNetwork: (uint32_t)network node: (unsigned char [_Nonnull IPX_NODE_LEN])node port: (uint16_t)port exception: (nullable id)exception; @end /** * @class OFSPXSocket OFSPXSocket.h ObjFW/OFSPXSocket.h * * @brief A class which provides methods to create and use SPX sockets. * |
︙ | ︙ | |||
81 82 83 84 85 86 87 | */ @property OF_NULLABLE_PROPERTY (assign, nonatomic) id <OFSPXSocketDelegate> delegate; /** * @brief Connect the OFSPXSocket to the specified destination. * | < > > | < | < > > | < | < > > | < | | > | < | | > | < | | | | 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | */ @property OF_NULLABLE_PROPERTY (assign, nonatomic) id <OFSPXSocketDelegate> delegate; /** * @brief Connect the OFSPXSocket to the specified destination. * * @param network The network on which the node to connect to is * @param node The node to connect to * @param port The port (sometimes also called socket number) on the node to * connect to */ - (void)connectToNetwork: (uint32_t)network node: (unsigned char [_Nonnull IPX_NODE_LEN])node port: (uint16_t)port; /** * @brief Asynchronously connect the OFSPXSocket to the specified destination. * * @param network The network on which the node to connect to is * @param node The node to connect to * @param port The port (sometimes also called socket number) on the node to * connect to */ - (void)asyncConnectToNetwork: (uint32_t)network node: (unsigned char [_Nonnull IPX_NODE_LEN])node port: (uint16_t)port; /** * @brief Asynchronously connect the OFSPXSocket to the specified destination. * * @param network The network on which the node to connect to is * @param node The node to connect to * @param port The port (sometimes also called socket number) on the node to * connect to * @param runLoopMode The run loop mode in which to perform the async connect */ - (void)asyncConnectToNetwork: (uint32_t)network node: (unsigned char [_Nonnull IPX_NODE_LEN])node port: (uint16_t)port runLoopMode: (OFRunLoopMode)runLoopMode; #ifdef OF_HAVE_BLOCKS /** * @brief Asynchronously connect the OFSPXSocket to the specified destination. * * @param node The node to connect to * @param network The network on which the node to connect to is * @param port The port (sometimes also called socket number) on the node to * connect to * @param block The block to execute once the connection has been established */ - (void)asyncConnectToNetwork: (uint32_t)network node: (unsigned char [_Nonnull IPX_NODE_LEN])node port: (uint16_t)port block: (OFSPXSocketAsyncConnectBlock)block; /** * @brief Asynchronously connect the OFSPXSocket to the specified destination. * * @param node The node to connect to * @param network The network on which the node to connect to is * @param port The port (sometimes also called socket number) on the node to * connect to * @param runLoopMode The run loop mode in which to perform the async connect * @param block The block to execute once the connection has been established */ - (void)asyncConnectToNetwork: (uint32_t)network node: (unsigned char [_Nonnull IPX_NODE_LEN])node port: (uint16_t)port runLoopMode: (OFRunLoopMode)runLoopMode block: (OFSPXSocketAsyncConnectBlock)block; #endif /** * @brief Bind the socket to the specified network, node and port. * * @param port The port (sometimes called socket number) to bind to. 0 means to * pick one and return it. * @return The address on which this socket can be reached */ - (OFSocketAddress)bindToPort: (uint16_t)port; @end OF_ASSUME_NONNULL_END |