ObjFW  All files named "src/OFUDPSocket.m"

History for src/OFUDPSocket.m

2024-01-02
17:17
Update copyright file: [a826172472] check-in: [26ddd2e4e4] user: js, branch: trunk, size: 4801 [annotate] [blame] [check-ins using] [diff]
2023-05-21
10:04
OFUDPSocket: Return socket address bound to file: [c3dd64f929] check-in: [65154c2576] user: js, branch: trunk, size: 4801 [annotate] [blame] [check-ins using] [diff]
2023-01-06
09:04
Update copyright file: [bb467c718b] check-in: [8939cbdb52] user: js, branch: trunk, size: 5109 [annotate] [blame] [check-ins using] [diff]
2022-12-27
13:58
Rename OFAlready{Connected -> Open}Exception file: [2ed8120a61] check-in: [29a41e5a78] user: js, branch: trunk, size: 5109 [annotate] [blame] [check-ins using] [diff]
2022-10-22
18:51
Fix overlooked OFSocketAddress(Set)Port file: [67c55bc52f] check-in: [64fc4f6344] user: js, branch: trunk, size: 5119 [annotate] [blame] [check-ins using] [diff]
18:41
OFSocket: Don't combine port for IP and IPX

While it works for those two protocols, it's a bad precedent as other
protocols have different types for ports. file: [f8c53776df] check-in: [a54730b88f] user: js, branch: trunk, size: 5117 [annotate] [blame] [check-ins using] [diff]

16:00
Split OFBindSocketFailedException into subclasses file: [fd8f9dff29] check-in: [72db6b3c6f] user: js, branch: trunk, size: 5099 [annotate] [blame] [check-ins using] [diff]
15:07
Rename OFBind{ -> Socket}FailedException file: [080326bc21] check-in: [35b565d369] user: js, branch: trunk, size: 5085 [annotate] [blame] [check-ins using] [diff]
2022-08-06
21:14
Don't use struct sockaddr in OFSocketAddress

struct sockaddr can contain a variable length array, which breaks the
union. file: [61fa5cfa02] check-in: [25adea9a23] user: js, branch: trunk, size: 5043 [annotate] [blame] [check-ins using] [diff]

2022-02-12
07:46
Update copyright file: [b89b6c4724] check-in: [1a86b8175b] user: js, branch: trunk, size: 5004 [annotate] [blame] [check-ins using] [diff]
2021-10-15
16:15
OFUDPSocket: Fix compiling for HP-UX / Wii / 3DS file: [bb035d1ec6] check-in: [50641eb716] user: js, branch: trunk, size: 5004 [annotate] [blame] [check-ins using] [diff]
2021-04-18
23:18
INVALID_SOCKET -> OFInvalidSocketHandle file: [5d65cff83a] check-in: [4b587c8874] user: js, branch: new-naming-convention, size: 5033 [annotate] [blame] [check-ins using] [diff]
22:56
Rename all symbols marked extern file: [36850f3267] check-in: [e73c65a849] user: js, branch: new-naming-convention, size: 4984 [annotate] [blame] [check-ins using] [diff]
20:51
Rename everything in several smaller files file: [c0ef3d326a] check-in: [35de667566] user: js, branch: new-naming-convention, size: 4995 [annotate] [blame] [check-ins using] [diff]
15:55
Rename all functions in macros.h file: [24f3c5b76d] check-in: [7392685ffc] user: js, branch: new-naming-convention, size: 4992 [annotate] [blame] [check-ins using] [diff]
2021-04-17
13:58
of_socket_address_t -> OFSocketAddress file: [b4763512f7] check-in: [e3c5bb70dd] user: js, branch: new-naming-convention, size: 4990 [annotate] [blame] [check-ins using] [diff]
2021-03-07
20:25
*.m: Fold methods into one line where it fits file: [ab91d5347a] check-in: [1b82d3bf4f] user: js, branch: trunk, size: 5043 [annotate] [blame] [check-ins using] [diff]
2021-01-14
02:29
Define _HPUX_ALT_XOPEN_SOCKET_API where necessary

There is a nasty bug in HP-UX: When using the proper socket APIs that
take a socklen_t (which is 64 bit in LP64 mode), it still calls into
methods that expect an int - so there is a type mismatch between the
headers and the compiled system libraries. This leads to all socklen_t
being interpreted as 0 (due to big endian). Defining
_HPUX_ALT_XOPEN_SOCKET_API makes it use the correct symbols in the
system libraries instead. file: [26835c8d41] check-in: [1833194867] user: js, branch: trunk, size: 5054 [annotate] [blame] [check-ins using] [diff]

2021-01-02
22:06
Update copyright file: [44b93ee23f] check-in: [27b401c7c2] user: js, branch: amiga-library, size: 4887 [annotate] [blame] [check-ins using] [diff]
22:04
Update copyright file: [284e645ef0] check-in: [374e1a1bfa] user: js, branch: trunk, size: 4948 [annotate] [blame] [check-ins using] [diff]
2021-01-01
22:27
Workaround for binding to UDP port 0 on HP-UX file: [19321c5f2d] check-in: [c98b667229] user: js, branch: trunk, size: 5037 [annotate] [blame] [check-ins using] [diff]
2020-06-28
15:03
Use OF_DIRECT(_MEMBERS) where appropriate file: [8b135fcca2] check-in: [b6cb3addd0] user: js, branch: trunk, size: 4976 [annotate] [blame] [check-ins using] [diff]
2020-05-06
00:32
Improve names of several properties file: [851b1788ef] check-in: [bc67e98833] user: js, branch: trunk, size: 4966 [annotate] [blame] [check-ins using] [diff]
2020-04-26
16:21
Add OFSequencedPacketSocket

This is intended for SCTP and SPX. file: [2b709ddc80] check-in: [e5b2ee56ff] user: js, branch: trunk, size: 4966 [annotate] [blame] [check-ins using] [diff]

2020-04-25
17:05
Add OFDatagramSocket as base class for OFUDPSocket

This makes it easier to reuse code for other datagram sockets, namely
IPX. file: [62f6a25c2d] check-in: [b02c4b05bb] user: js, branch: trunk, size: 4891 [annotate] [blame] [check-ins using] [diff]

2020-01-02
01:51
Update copyright file: [c8408c9960] check-in: [c7f0229795] user: js, branch: trunk, size: 11926 [annotate] [blame] [check-ins using] [diff]
2019-10-07
00:07
OFDNSResolver: Major refactor

This temporarily doesn't use the search domains anymore and makes CNAMEs
slightly more inefficient. The next commits will fix both. file: [de0f80ba6e] check-in: [ee592cf603] user: js, branch: trunk, size: 11923 [annotate] [blame] [check-ins using] [diff]

2019-08-09
23:44
Support sockets on AmigaOS 3 file: [e6c74d7c76] check-in: [3dec8ecf2e] user: js, branch: trunk, size: 11928 [annotate] [blame] [check-ins using] [diff]
2019-01-07
22:59
Partially fix sockets on Nintendo 3DS/Wii

This does not fully fix it yet, but at least the socket tests in the
test suite pass on 3DS now. file: [08c14deedf] check-in: [ab89c47f42] user: js, branch: trunk, size: 11896 [annotate] [blame] [check-ins using] [diff]

2019-01-03
19:13
Update copyright file: [20728b2787] check-in: [0509d7a844] user: js, branch: trunk, size: 11865 [annotate] [blame] [check-ins using] [diff]
2018-12-18
21:17
Use OFData instead of a buffer for async UDP sends

This avoids the entire problem of keeping the buffer alive until the
send finished. file: [83f1dff89c] check-in: [0f3ae90eef] user: js, branch: trunk, size: 11859 [annotate] [blame] [check-ins using] [diff]

17:10
Slightly decrease binary size file: [9559b91b20] check-in: [3501205f07] user: js, branch: trunk, size: 12072 [annotate] [blame] [check-ins using] [diff]
2018-12-08
18:55
OFUDPSocket: Use a delegate for async operations file: [a173a95dac] check-in: [da2dd2dde5] user: js, branch: trunk, size: 11927 [annotate] [blame] [check-ins using] [diff]
2018-11-04
18:40
Sandbox ofdns file: [c73a7a1b74] check-in: [605634184d] user: js, branch: trunk, size: 12457 [annotate] [blame] [check-ins using] [diff]
2018-10-27
21:14
Fix compilation with newer MinGW-w64 versions file: [11089b6c20] check-in: [0036c4c22e] user: js, branch: trunk, size: 12394 [annotate] [blame] [check-ins using] [diff]
2018-10-07
02:06
Remove resolver.m

Instead, OFDNSResolver is used for everything now. file: [073268c5ca] check-in: [6e9ee122eb] user: js, branch: trunk, size: 12389 [annotate] [blame] [check-ins using] [diff]

2018-09-29
14:45
OFUDPSocket: Allow specifying the run loop mode file: [e0fb2ac475] check-in: [b90d4055a1] user: js, branch: trunk, size: 15948 [annotate] [blame] [check-ins using] [diff]
2018-09-24
00:13
OFRunLoop: Add support for modes file: [a374d3e9ed] check-in: [3fb96dff3c] user: js, branch: trunk, size: 14477 [annotate] [blame] [check-ins using] [diff]
2018-08-26
18:39
Fix compilation for Wii

This pretends that net_getsockopt() exists, which it does not yet. As
soon as it lands in libogc, this will work again. file: [06139f0b65] check-in: [bed2db0fd3] user: js, branch: trunk, size: 14277 [annotate] [blame] [check-ins using] [diff]

2018-08-11
21:53
Fix build on 3DS and Wii file: [22a70e2ff3] check-in: [9a494f183b] user: js, branch: trunk, size: 14274 [annotate] [blame] [check-ins using] [diff]
14:00
Change the layout of of_socket_address_t

Instead of containing a struct sockaddr_storage - which does not exist
on all supported platforms - it now contains a union of all struct
sockaddr_* types.

Additionally, if struct sockaddr_in6 does not exist, it is defined so
that an IPv6 can be stored even if the system does not support IPv6. file: [1e4bb48119] check-in: [8f810ecb7e] user: js, branch: trunk, size: 14217 [annotate] [blame] [check-ins using] [diff]

2018-08-04
16:23
Support for non-blocking UDP sockets file: [6cab00e4d5] check-in: [7de9d67be9] user: js, branch: trunk, size: 13776 [annotate] [blame] [check-ins using] [diff]
15:35
Use OF_HAVE_IPV6 instead of HAVE_IPV6

This has always been wrong. file: [6754e57a6e] check-in: [e36455441d] user: js, branch: trunk, size: 12961 [annotate] [blame] [check-ins using] [diff]

2018-07-28
20:21
Add of_socket_address_ip_string()

This replaces of_address_to_string_and_port(). file: [df2fd645d0] check-in: [8aeee6680a] user: js, branch: trunk, size: 12952 [annotate] [blame] [check-ins using] [diff]

17:38
Rename of_{udp_ -> }socket_address file: [a0a08f26fb] check-in: [b16f2b9e25] user: js, branch: trunk, size: 13188 [annotate] [blame] [check-ins using] [diff]
2018-01-03
19:49
Update copyright notice file: [f99cdecba3] check-in: [7e5c81e186] user: js, branch: trunk, size: 16016 [annotate] [blame] [check-ins using] [diff]
2017-10-22
15:05
Make Apple GCC with -Wshadow happy file: [488e7d77d9] check-in: [a06354b42a] user: js, branch: trunk, size: 15993 [annotate] [blame] [check-ins using] [diff]
14:09
Make Apple GCC with -Wshadow happy file: [fdfc6330cc] check-in: [31c0f5b89e] user: js, branch: 0.90, size: 14929 [annotate] [blame] [check-ins using] [diff]
2017-10-17
00:33
Do not use implicit method return types

Instead, explicitly declare them, as OF_ASSUME_NONNULL_{BEGIN,END} does
not apply to implicit return types. This means that after this commit,
all init methods have a nonnull return type, as they should have. file: [8a3b636da1] check-in: [2f4e0df8be] user: js, branch: trunk, size: 15924 [annotate] [blame] [check-ins using] [diff]

2017-09-24
17:35
OFUDPSocket: Add support for async sending file: [35a4b455a8] check-in: [842c55dd83] user: js, branch: trunk, size: 15814 [annotate] [blame] [check-ins using] [diff]
11:24
Change type for async exceptions to id file: [971c30a9d2] check-in: [f8498bb114] user: js, branch: trunk, size: 15069 [annotate] [blame] [check-ins using] [diff]
2017-09-23
22:07
Support for passing a context to async IO handlers file: [c1cf4f8ea1] check-in: [958da109d3] user: js, branch: trunk, size: 15111 [annotate] [blame] [check-ins using] [diff]
2017-06-12
22:29
OFWriteFailedException: Add -[bytesWritten]

This allows retrieving the number of bytes already written before the
write failed, allowing to retry without writing data that has already
been written. file: [c8e3c83553] check-in: [2ae01218ef] user: js, branch: trunk, size: 14860 [annotate] [blame] [check-ins using] [diff]

2017-05-22
23:31
Make includes of unistd.h and fcntl.h conditional file: [a9d215ce51] check-in: [1287e77e04] user: js, branch: trunk, size: 14577 [annotate] [blame] [check-ins using] [diff]
2017-05-21
23:57
Use closesocket() instead of close()

Previously, socket_helpers.h would just define close() to whatever is
needed to close a socket. However, this makes it possible to
accidentally call a socket-specific close on something that is not a
socket. Having to explicitly call closesocket() (and defining it to
close() on platforms where it's the same) prevents this. file: [83754f70d8] check-in: [b4cd87cd81] user: js, branch: trunk, size: 14549 [annotate] [blame] [check-ins using] [diff]

21:28
Prefix private methods with of_ instead of OF_

This matches Apple's style. file: [06ff6d8241] check-in: [6b77a5dd8b] user: js, branch: trunk, size: 14519 [annotate] [blame] [check-ins using] [diff]

2017-05-07
20:10
Small code style change

Casts are now written like types in variable declarations. file: [f67659d08d] check-in: [4af49a13c3] user: js, branch: trunk, size: 14519 [annotate] [blame] [check-ins using] [diff]

2017-01-09
17:36
Update copyright

Forgot to add 2017, even though I already did quite some changes in
2017. file: [7e2210cd91] check-in: [44f45c2e35] user: js, branch: trunk, size: 14478 [annotate] [blame] [check-ins using] [diff]

2016-05-06
20:54
Make GCC happy with -Wsign-compare file: [bc2dead81f] check-in: [e840997cc8] user: js, branch: trunk, size: 14472 [annotate] [blame] [check-ins using] [diff]
2016-03-27
23:10
Add socket support for Nintendo 3DS

This removes the port registry that existed for the Wii and instead
tries binding to random ports in a loop until it succeeds or errno is
not EADDRINUSE. This is done for the Wii and Nintendo 3DS now.

This also includes several other socket-related cleanups. file: [ad50b942db] check-in: [12b8a7552e] user: js, branch: trunk, size: 14423 [annotate] [blame] [check-ins using] [diff]

2016-02-21
15:37
Make use of C99-style for loops file: [40c5efdd20] check-in: [e0b9167693] user: js, branch: trunk, size: 13796 [annotate] [blame] [check-ins using] [diff]
2016-01-03
00:43
Update copyright

While at it, also update the mail address. file: [966fc51bdc] check-in: [cec0f072f8] user: js, branch: 0.8, size: 13305 [annotate] [blame] [check-ins using] [diff]

00:41
Update copyright

While at it, also update the mail address. file: [0280b236b8] check-in: [2a27cf3000] user: js, branch: trunk, size: 13800 [annotate] [blame] [check-ins using] [diff]

2015-10-19
22:15
Add platform.h & make platform defines consistent file: [3db951aa5f] check-in: [1ba08eebc5] user: js, branch: trunk, size: 13796 [annotate] [blame] [check-ins using] [diff]
2015-10-17
10:59
Add a port registry for the Wii

This is necessary as the Wii does not allow picking a random free port,
and thus we need to track which ports are used. file: [b7f838da94] check-in: [ed4549ddd3] user: js, branch: trunk, size: 13789 [annotate] [blame] [check-ins using] [diff]

2015-10-04
11:30
Better length checks for write / send calls file: [3c90c2bfad] check-in: [fc73801932] user: js, branch: trunk, size: 13301 [annotate] [blame] [check-ins using] [diff]
11:11
Special cases for the Wii's weird network stack

This fixes the tests on Wii. file: [182b0b3dfd] check-in: [4cecf82254] user: js, branch: trunk, size: 13205 [annotate] [blame] [check-ins using] [diff]

2015-09-14
13:50
OFUDPSocket: More constness file: [b3ff5858a7] check-in: [605fc10fad] user: js, branch: trunk, size: 12968 [annotate] [blame] [check-ins using] [diff]
2015-06-28
16:16
Extremely minor API inconsistency fix file: [c798b7ff61] check-in: [1b1db13483] user: js, branch: trunk, size: 12962 [annotate] [blame] [check-ins using] [diff]
2015-05-14
09:58
Clean up a few file and socket related checks file: [1641047e8d] check-in: [b37fdafac1] user: js, branch: trunk, size: 12966 [annotate] [blame] [check-ins using] [diff]
2015-05-06
20:18
OFNotConnectedException -> OFNotOpenException file: [4e13070b06] check-in: [ff759684e2] user: js, branch: trunk, size: 12946 [annotate] [blame] [check-ins using] [diff]
2015-03-22
11:42
Abstract int vs SOCKET as of_socket_t file: [5a2d407327] check-in: [099e939079] user: js, branch: trunk, size: 12966 [annotate] [blame] [check-ins using] [diff]
2015-02-18
22:56
Add of_getsockname() and make use of it

of_getsockname() calls getsockname() after acquiring a mutex. This is
necessary as some implementations of getsockname() are not thread-safe. file: [455c967f24] check-in: [f18615e057] user: js, branch: trunk, size: 12874 [annotate] [blame] [check-ins using] [diff]

2015-02-16
08:39
Explicitly pass errno to exceptions

The old behaviour where the exception would access errno directly on
creation of the exception was very fragile. The two main problems with
it were that sometimes it would pick up an errno even though none had
been set and in other cases that when the exception was created errno
had already been overridden.

This also greatly increases errno handling on Win32, especially in
conjunction with sockets. It can still be improved further, though. file: [3c38516b1b] check-in: [62e2de30b9] user: js, branch: trunk, size: 12842 [annotate] [blame] [check-ins using] [diff]

2015-01-17
18:39
Fix compilation on Win32 file: [386cfc0afe] check-in: [8b0caeabde] user: js, branch: trunk, size: 12521 [annotate] [blame] [check-ins using] [diff]
2015-01-03
20:57
Update copyright file: [195d7f3dac] check-in: [cfd374b906] user: js, branch: trunk, size: 12429 [annotate] [blame] [check-ins using] [diff]
2014-12-13
16:52
Use CLOEXEC for files and sockets file: [a6f8078486] check-in: [06d2de4571] user: js, branch: trunk, size: 12423 [annotate] [blame] [check-ins using] [diff]
2014-06-21
21:43
Move all macros from OFObject.h to macros.h

This means that OFObject.h imports macros.h now, making it unnecessary
to manually import macros.h in almost every file. And while at it, also
import autorelease.h in OFObject.h, so that this doesn't need to be
manually imported in almost every file as well. file: [2b1705fa68] check-in: [13ee56edf3] user: js, branch: trunk, size: 12231 [annotate] [blame] [check-ins using] [diff]

2014-04-26
00:40
Fix a few issues on LLP64 and Win64

LLP64 was mostly fast enumeration using an unsigned long for the state,
which can't store a pointer or a size_t on LLP64. This is now solved by
either throwing an OFOutOfRangeException if the value of the size_t is
bigger than ULONG_MAX or storing the pointer in the extra field (copied
using memcpy, as it's an array of unsigned long, which again would be
too small to store a pointer).

Win64 was mostly Microsoft not being able to decide whether a length is
a size_t, a DWORD, an int or an unsigned int (thus the different types
in places that seem to be almost the same). But since that would not be
confusing enough, a file descriptor is an int if it's for a file, but a
long long if it is for a socket. But of course, for ReadFile and friends
it's a DWORD instead of an int then. file: [473e259227] check-in: [4e59d2692f] user: js, branch: trunk, size: 12274 [annotate] [blame] [check-ins using] [diff]

2014-04-14
00:45
Coding style

No functional change intended. file: [9fe4ea7a6f] check-in: [9da9b2b64c] user: js, branch: trunk, size: 11390 [annotate] [blame] [check-ins using] [diff]

2014-02-21
17:17
Cast return of sizeof() to socklen_t

It caused a warning about an implicit cast on OS X/PPC64. file: [aca7fe3ad4] check-in: [3fa37632f9] user: js, branch: trunk, size: 11385 [annotate] [blame] [check-ins using] [diff]

2014-02-04
21:45
OFUDPSocket: Conform to OFCopying file: [19a4211bbd] check-in: [f836f5e65d] user: js, branch: trunk, size: 11363 [annotate] [blame] [check-ins using] [diff]
2014-02-03
14:43
Move socket initialization to a single place file: [e488747830] check-in: [414c87ec13] user: js, branch: trunk, size: 11324 [annotate] [blame] [check-ins using] [diff]
2014-01-31
13:07
Minor fixes (missing ifdefs, etc.) file: [851d26fee8] check-in: [60cb25ab50] user: js, branch: trunk, size: 11111 [annotate] [blame] [check-ins using] [diff]
2014-01-30
22:02
OFUDPSocket: Add async resolve / receive file: [4a64bf06a1] check-in: [ff3c507941] user: js, branch: trunk, size: 11111 [annotate] [blame] [check-ins using] [diff]
12:26
Rename +[UDPSocket hostForAddress:port:]

It is now called +[getHost:andPort:forAddress:]. This makes it much
clearer from the selector alone what it actually does. file: [584c86fff6] check-in: [fb590316ba] user: js, branch: trunk, size: 6996 [annotate] [blame] [check-ins using] [diff]

2014-01-29
15:59
OFUDPSocket: Add observing file: [e5e2000892] check-in: [c4f36e3692] user: js, branch: trunk, size: 6964 [annotate] [blame] [check-ins using] [diff]
2014-01-27
22:01
Added: Add OFUDPSocket

Async operations will follow later. file: [72deb2c0c0] check-in: [5025cba435] user: js, branch: trunk, size: 6856 [annotate] [blame] [check-ins using]