Differences From Artifact [86e7a28476]:
- File
src/OFDDPSocket.h
— part of check-in
[9c2f20e736]
at
2022-11-03 00:14:27
on branch trunk
— OFDDPSocket: Don't include the type with the data
This seems to be an oddity limited to OSes that have implemented DDP
exclusively for netatalk, while macOS and Windows don't include it with
the data.While on macOS it's possible to achieve the previous behavior via some
hacks, this is impossible on Windows, so the proper approach is to
handle it like everybody else: Specify the protocol type when binding
and only handle packets of the correct protocol type. (user: js, size: 3281) [annotate] [blame] [check-ins using] [more...]
To Artifact [d9acc0eea7]:
- File
src/OFDDPSocket.h
— part of check-in
[550bd1b7bb]
at
2023-05-21 13:10:40
on branch trunk
— Remove support for configuring AppleTalk
This didn't work without problems on all OSes. Since ofatalkcfg is no
longer there, there is no reason to keep this for now. In the future, if
there is a more generic replacement for ofatalkcfg, this can just be
reverted. (user: js, size: 3351) [annotate] [blame] [check-ins using] [more...]
1 | /* | | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | /* * Copyright (c) 2008-2023 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. * * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFDatagramSocket.h" OF_ASSUME_NONNULL_BEGIN @class OFString; @class OFDictionary OF_GENERIC(KeyType, ObjectType); /** * @protocol OFDDPSocketDelegate OFDDPSocket.h ObjFW/OFDDPSocket.h * * @brief A delegate for OFDDPSocket. */ @protocol OFDDPSocketDelegate <OFDatagramSocketDelegate> |
︙ | ︙ | |||
39 40 41 42 43 44 45 | * @ref OFSocketAddressAppleTalkNode to get the AppleTalk node and * @ref OFSocketAddressAppleTalkPort to get the port (sometimes also called * socket number). * * @note On some systems, packets received with the wrong protocol type just * get filtered by the kernel, however, on other systems, the packet is * queued up and will raise an @ref OFReadFailedException with the | | | 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | * @ref OFSocketAddressAppleTalkNode to get the AppleTalk node and * @ref OFSocketAddressAppleTalkPort to get the port (sometimes also called * socket number). * * @note On some systems, packets received with the wrong protocol type just * get filtered by the kernel, however, on other systems, the packet is * queued up and will raise an @ref OFReadFailedException with the * @ref OFReadFailedException#errNo set to `ENOMSG` when being received. * * @warning Even though the OFCopying protocol is implemented, it does *not* * return an independent copy of the socket, but instead retains it. * This is so that the socket can be used as a key for a dictionary, * so context can be associated with a socket. Using a socket in more * than one thread at the same time is not thread-safe, even if copy * was called to create one "instance" for every thread! |
︙ | ︙ | |||
77 78 79 80 81 82 83 | * @param port The port to bind to. 0 means to pick one and return it via the * returned socket address. * @param protocolType The DDP protocol type to use. Must not be 0. If you want * to use DDP directly and not a protocol built on top of * it, use 11 for compatibility with Open Transport. * @return The address on which this socket can be reached * @throw OFBindDDPSockeFailedException Binding failed | | | 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | * @param port The port to bind to. 0 means to pick one and return it via the * returned socket address. * @param protocolType The DDP protocol type to use. Must not be 0. If you want * to use DDP directly and not a protocol built on top of * it, use 11 for compatibility with Open Transport. * @return The address on which this socket can be reached * @throw OFBindDDPSockeFailedException Binding failed * @throw OFAlreadyOpenException The socket is already bound */ - (OFSocketAddress)bindToNetwork: (uint16_t)network node: (uint8_t)node port: (uint8_t)port protocolType: (uint8_t)protocolType; @end OF_ASSUME_NONNULL_END |