ObjFW  History of src/OFStreamSocket.m of ffb91daffe96f478

History of the file that is called src/OFStreamSocket.m at checkin ffb91daffe96f478

2021-05-08
19:30
Fix setCanBlock: being inverted on Windows/AmigaOS file: [5b9cb9181f] check-in: [91131d6d7d] user: js, branch: trunk, size: 8369 [annotate] [blame] [check-ins using] [diff]
2021-04-18
23:18
INVALID_SOCKET -> OFInvalidSocketHandle file: [a955b9500f] check-in: [4b587c8874] user: js, branch: new-naming-convention, size: 8367 [annotate] [blame] [check-ins using] [diff]
22:56
Rename all symbols marked extern file: [0813befdb2] check-in: [e73c65a849] user: js, branch: new-naming-convention, size: 8264 [annotate] [blame] [check-ins using] [diff]
20:51
Rename everything in several smaller files file: [5c58a6db92] check-in: [35de667566] user: js, branch: new-naming-convention, size: 8286 [annotate] [blame] [check-ins using] [diff]
2021-04-17
13:58
of_socket_address_t -> OFSocketAddress file: [3262c13b9d] check-in: [e3c5bb70dd] user: js, branch: new-naming-convention, size: 8285 [annotate] [blame] [check-ins using] [diff]
03:37
of_run_loop_mode_t -> OFRunLoopMode file: [81e1bbc5f7] check-in: [b480ef54db] user: js, branch: new-naming-convention, size: 8311 [annotate] [blame] [check-ins using] [diff]
03:21
Rename all blocks file: [ac4dcd7238] check-in: [c4e0e56fa3] user: js, branch: new-naming-convention, size: 8336 [annotate] [blame] [check-ins using] [diff]
2021-03-07
20:25
*.m: Fold methods into one line where it fits file: [7f5d88caa9] check-in: [1b82d3bf4f] user: js, branch: trunk, size: 8350 [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: [791405f855] check-in: [1833194867] user: js, branch: trunk, size: 8364 [annotate] [blame] [check-ins using] [diff]

2021-01-13
23:01
Wrap _XOPEN_SOURCE_EXTENDED define in #ifndef file: [731a6e9d3a] check-in: [430d54e2a9] user: js, branch: trunk, size: 8329 [annotate] [blame] [check-ins using] [diff]
19:16
Define _XOPEN_SOURCE_EXTENDED where necessary file: [66cf0a873d] check-in: [d55b73f38e] user: js, branch: trunk, size: 8290 [annotate] [blame] [check-ins using] [diff]
2021-01-02
22:04
Update copyright file: [37c1cc3f6d] check-in: [374e1a1bfa] user: js, branch: trunk, size: 8259 [annotate] [blame] [check-ins using] [diff]
2020-05-06
00:32
Improve names of several properties file: [2df2daa037] check-in: [bc67e98833] user: js, branch: trunk, size: 8348 [annotate] [blame] [check-ins using] [diff]
2020-04-26
18:10
Move accept and listen OF{TCP -> Stream}Socket file: [1b3aa72b95] check-in: [13a8f43898] user: js, branch: trunk, size: 8340 [annotate] [blame] [check-ins using] [diff]
16:21
Add OFSequencedPacketSocket

This is intended for SCTP and SPX. file: [53952137a2] check-in: [e5b2ee56ff] user: js, branch: trunk, size: 4323 [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: [3d9d6aa117] check-in: [b02c4b05bb] user: js, branch: trunk, size: 4333 [annotate] [blame] [check-ins using] [diff]

2020-01-12
16:22
Cancel async requests in OFStreamSocket instead

Closing them in OFStream would result in always canceling them after
closing the socket due to the -[close] chaining - which could never
work. file: [6026b8fcfc] check-in: [cea3f2133d] user: js, branch: trunk, size: 4136 [annotate] [blame] [check-ins using] [diff]

2020-01-02
01:51
Update copyright file: [bc21bce60d] check-in: [c7f0229795] user: js, branch: trunk, size: 4076 [annotate] [blame] [check-ins using] [diff]
2019-08-09
23:44
Support sockets on AmigaOS 3 file: [d9c06730da] check-in: [3dec8ecf2e] user: js, branch: trunk, size: 4073 [annotate] [blame] [check-ins using] [diff]
2019-06-26
20:38
Fix non-blocking sockets on MorphOS file: [f3b8b9f100] check-in: [d1d1843970] user: js, branch: trunk, size: 4065 [annotate] [blame] [check-ins using] [diff]
2019-01-03
19:13
Update copyright file: [0652ea9722] check-in: [0509d7a844] user: js, branch: trunk, size: 3984 [annotate] [blame] [check-ins using] [diff]
2018-08-04
16:23
Support for non-blocking UDP sockets file: [8a940fe4f3] check-in: [7de9d67be9] user: js, branch: trunk, size: 3978 [annotate] [blame] [check-ins using] [diff]
2018-01-03
19:49
Update copyright notice file: [0965d972e9] check-in: [7e5c81e186] user: js, branch: trunk, size: 5371 [annotate] [blame] [check-ins using] [diff]
2017-11-19
12:56
Fix compilation with GCC file: [de7c76a291] check-in: [615a9f2eba] user: js, branch: trunk, size: 5348 [annotate] [blame] [check-ins using] [diff]
2017-09-24
12:24
OFStream: Add support for async writes file: [c5ebdea8f5] check-in: [481225349f] user: js, branch: trunk, size: 3916 [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: [272212f745] check-in: [2ae01218ef] user: js, branch: trunk, size: 4073 [annotate] [blame] [check-ins using] [diff]

2017-06-05
15:51
OFStream: Don't throw when at end of stream

Instead, let reads return 0 and let writes append after the end. file: [eec652ecb7] check-in: [f9cd4f9cab] user: js, branch: trunk, size: 3785 [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: [c248fb563e] check-in: [b4cd87cd81] user: js, branch: trunk, size: 3980 [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: [d2e763431e] check-in: [4af49a13c3] user: js, branch: trunk, size: 3974 [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: [196ec0c55f] check-in: [44f45c2e35] user: js, branch: trunk, size: 3972 [annotate] [blame] [check-ins using] [diff]

2016-06-07
22:56
Add support for reusing OFStreams after close

Right now, this is only useful for OFTCPSocket, as this is the only
class so far not establishing the stream in the init method. However,
this adds the general infrastructure to allow reuse to all subclasses of
OFStream. file: [77a66a4df1] check-in: [1de551cb5f] user: js, branch: trunk, size: 3966 [annotate] [blame] [check-ins using] [diff]

2016-01-03
00:43
Update copyright

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

00:41
Update copyright

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

2015-10-19
22:15
Add platform.h & make platform defines consistent file: [5d34917197] check-in: [1ba08eebc5] user: js, branch: trunk, size: 3945 [annotate] [blame] [check-ins using] [diff]
2015-10-04
11:30
Better length checks for write / send calls file: [5f9b6a238d] check-in: [fc73801932] user: js, branch: trunk, size: 3925 [annotate] [blame] [check-ins using] [diff]
2015-05-06
20:18
OFNotConnectedException -> OFNotOpenException file: [d996f514e3] check-in: [ff759684e2] user: js, branch: trunk, size: 3849 [annotate] [blame] [check-ins using] [diff]
2015-03-22
11:42
Abstract int vs SOCKET as of_socket_t file: [2a1777ff58] check-in: [099e939079] user: js, branch: trunk, size: 3869 [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: [c547367b26] check-in: [62e2de30b9] user: js, branch: trunk, size: 3777 [annotate] [blame] [check-ins using] [diff]

2015-01-03
20:57
Update copyright file: [70d50e1c9d] check-in: [cfd374b906] user: js, branch: trunk, size: 3697 [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: [43c1e24000] check-in: [4e59d2692f] user: js, branch: trunk, size: 3691 [annotate] [blame] [check-ins using] [diff]

2014-02-18
00:22
Move around a few defines to be more consistent file: [8ed3399f44] check-in: [f9d12201f8] user: js, branch: trunk, size: 2912 [annotate] [blame] [check-ins using] [diff]
2014-02-03
14:43
Move socket initialization to a single place file: [917f870ee4] check-in: [414c87ec13] user: js, branch: trunk, size: 2912 [annotate] [blame] [check-ins using] [diff]
2014-01-26
13:32
Include unistd.h in socket_helpers.h file: [0ca4a3134a] check-in: [32ad39007a] user: js, branch: trunk, size: 3108 [annotate] [blame] [check-ins using] [diff]
2014-01-25
19:33
Move socket includes and helpers to separate files

The new file socket.h includes all headers required for sockets on the
used platform, while the file socket_helpers.h defines the BSD API
functions to the platform specific functions if necessary.

This cleans up the classes dealing with sockets a lot and also reduces
code duplication. file: [c2425f91c0] check-in: [81d47f4398] user: js, branch: trunk, size: 3129 [annotate] [blame] [check-ins using] [diff]

17:39
Generalize stream / socket related exceptions

This is in preparation for adding UDP sockets, as UDP sockets and TCP
sockets have no common superclass, as one is stream-oriented while the
other is packet-oriented.

Read and write exceptions are for any object now, as they are useful for
a lot more than just for streams, while the others (bind, listen, etc.)
are for any socket now (the type is id in this case, though, as there is
no common superclass). file: [5b827e504d] check-in: [8d2a5052fd] user: js, branch: trunk, size: 3523 [annotate] [blame] [check-ins using] [diff]

2014-01-04
00:24
Update copyright. file: [42d45e3daf] check-in: [3b97fc3cd9] user: js, branch: trunk, size: 3523 [annotate] [blame] [check-ins using] [diff]
2013-06-28
18:48
OFHTTPClient: Only retry on ECONNRESET or EPIPE. file: [e9adb99946] check-in: [e0182a3e55] user: js, branch: trunk, size: 3517 [annotate] [blame] [check-ins using] [diff]
2013-06-22
12:12
Rework exceptions.

This mostly removes the argument for the class in which the exception
occurred. As backtraces were recently added for all platforms, the
passed class does not give any extra information on where the exception
occurred anymore.

This also removes a few other arguments which were not too helpful. In
the past, the idea was to pass as many arguments as possible so that it
is easier to find the origin of the exception. However, as backtraces
are a much better way to find the origin, those are not useful anymore
and just make the exception more cumbersome to use. The rule is now to
only pass arguments that might help in recovering from the exception or
provide information that is otherwise not easily accessible. file: [252939c90a] check-in: [3d16a30f41] user: js, branch: trunk, size: 3629 [annotate] [blame] [check-ins using] [diff]

2013-06-11
23:33
Initial sockets support for the Wii.

Not functional yet due to bugs in the SDK.
Bugs found so far:

* Binding to port 0 fails instead of choosing a free port.
* gethostbyname() does not work for IPs.
* getsockname() is missing.
* struct sockaddr_storage is missing.

I have not decided yet whether I fix those bugs in the SDK (I already
implemented getsockname() and added struct sockaddr_stroage and it seems
to work) or if I work around them in ObjFW. This will mainly depend on
how cooperative the developers of the Wii SDK are. file: [10e23bfd72] check-in: [ffb91daffe] user: js, branch: trunk, size: 3874 [annotate] [blame] [check-ins using] [diff]

2013-05-22
18:42
Check for more socket-related headers / functions. file: [05982c597a] check-in: [896084c340] user: js, branch: trunk, size: 3509 [annotate] [blame] [check-ins using] [diff]
2013-04-07
21:21
Fix Win32 #include hell. file: [f99014d0c7] check-in: [ec6b265428] user: js, branch: trunk, size: 3542 [annotate] [blame] [check-ins using] [diff]
2013-03-04
17:20
Replace BOOL with bool.

The only places where BOOL is left are those where they are required by
the ABI. file: [9ccd3888ba] check-in: [c5ef582958] user: js, branch: trunk, size: 3497 [annotate] [blame] [check-ins using] [diff]

2013-02-12
18:22
Prefix all ivars with an underscore. file: [a7e950a736] check-in: [e40729d406] user: js, branch: trunk, size: 3493 [annotate] [blame] [check-ins using] [diff]
2013-01-09
22:24
Update copyright. file: [902270c256] check-in: [813c00ccf0] user: js, branch: trunk, size: 3450 [annotate] [blame] [check-ins using] [diff]
2012-10-09
15:07
Make use of instancetype. file: [ccc1ba2bd0] check-in: [fb515e8e24] user: js, branch: trunk, size: 3444 [annotate] [blame] [check-ins using] [diff]
2012-09-16
15:43
OFStream: Use lowlevel as prefix instead of _. file: [b406096bcb] check-in: [61c1932caf] user: js, branch: trunk, size: 3430 [annotate] [blame] [check-ins using] [diff]
2012-09-12
17:27
Split -[OFStream fileDescriptor].

It is now -[fileDescriptorForReading] and -[fileDescriptorForWriting].
The split was necessary as some stream types (e.g. OFProcess) don't have
a single file descriptor, but two. This allows to use those stream types
with OFStreamObserver as well. file: [fbc78fae5c] check-in: [440e95fd4a] user: js, branch: trunk, size: 3409 [annotate] [blame] [check-ins using] [diff]

2012-07-12
01:28
Don't access isa directly. file: [987460de9d] check-in: [8892ae9fcc] user: js, branch: trunk, size: 3348 [annotate] [blame] [check-ins using] [diff]
2012-06-07
12:03
Rework OFStream API. file: [57d59bfcb8] check-in: [0d4059306a] user: js, branch: trunk, size: 3280 [annotate] [blame] [check-ins using] [diff]
2012-01-05
00:56
Update copyright. file: [acbc1571b5] check-in: [ce70e17b38] user: js, branch: trunk, size: 3279 [annotate] [blame] [check-ins using] [diff]
2011-09-22
23:25
Exceptions are now autoreleased.

This is safe as an "exception loop" can't happen, since if allocating
an exception fails, it throws an OFAllocFailedException which is
preallocated and can always be thrown.

So, the worst case would be that an autorelease of an exception fails,
triggering an OFOutOfMemoryException for which there is no memory,
resulting in an OFAllocFailedException to be thrown. file: [45578e9a1c] check-in: [e1e7ffa903] user: js, branch: trunk, size: 3273 [annotate] [blame] [check-ins using] [diff]

2011-09-19
12:34
BOOL naming conventions. file: [dffe75edba] check-in: [d43eb177bc] user: js, branch: trunk, size: 3197 [annotate] [blame] [check-ins using] [diff]
2011-09-10
18:36
Remove -[finalize] as ARC will be implemented instead of a GC. file: [35ae964d9d] check-in: [972a3ee40d] user: js, branch: trunk, size: 3209 [annotate] [blame] [check-ins using] [diff]
2011-07-17
01:55
Define __NO_EXT_QNX in files using unistd.h or fcntl.h.

Without this, the headers try to declare functions that use __block as
an argument name and thus fail to compile when using -fblocks. file: [49fed451d1] check-in: [59e52af26d] user: js, branch: 0.5, size: 3159 [annotate] [blame] [check-ins using] [diff]

01:55
Define __NO_EXT_QNX in files using unistd.h or fcntl.h.

Without this, the headers try to declare functions that use __block as
an argument name and thus fail to compile when using -fblocks. file: [73e9748565] check-in: [da2701ad14] user: js, branch: trunk, size: 3296 [annotate] [blame] [check-ins using] [diff]

2011-06-20
19:26
Let -[writeNBytes:fromBuffer:] return void. file: [8d5170a63f] check-in: [2a2d5c4c47] user: js, branch: trunk, size: 3272 [annotate] [blame] [check-ins using] [diff]
2011-06-16
02:33
-[readNBytes:intoBuffer:] & -[writeNBytes:fromBuffer:] take a void* now. file: [a6c16a5220] check-in: [8440a70457] user: js, branch: trunk, size: 3310 [annotate] [blame] [check-ins using] [diff]
2011-04-24
21:50
Add -[finalize] to all classes which would require it once we have GC. file: [a5c51abdbf] check-in: [07b3d0e8de] user: js, branch: trunk, size: 3310 [annotate] [blame] [check-ins using] [diff]
2011-04-22
20:19
More style improvements. file: [773bb7067f] check-in: [e76a7f52c1] user: js, branch: trunk, size: 3223 [annotate] [blame] [check-ins using] [diff]
18:00
More style improvements. file: [7c915a3b62] check-in: [4814266280] user: js, branch: trunk, size: 3265 [annotate] [blame] [check-ins using] [diff]
2011-04-06
18:30
Move ivar listening to OFTCPSocket.
Also, we don't need these ivars to be @public anymore.
file: [f8648491b3] check-in: [d776cbf5e2] user: js, branch: trunk, size: 3135 [annotate] [blame] [check-ins using] [diff]
2011-03-30
00:03
A few win32 fixes. file: [2a532fea1c] check-in: [13a4dee1da] user: js, branch: trunk, size: 3152 [annotate] [blame] [check-ins using] [diff]
2011-03-28
23:54
One more workaround for a bug in gcc 4.4.4 (possibly only Haiku). file: [24f92d1402] check-in: [12dd2db6ce] user: js, branch: trunk, size: 3071 [annotate] [blame] [check-ins using] [diff]
2011-03-24
21:17
Pass the stream for stream exceptions. file: [e1ff8d6e4c] check-in: [7ced2e7b6a] user: js, branch: trunk, size: 3121 [annotate] [blame] [check-ins using] [diff]
20:36
Pass the socket for socket exceptions. file: [60c85e14ca] check-in: [a8df2cff5f] user: js, branch: trunk, size: 3010 [annotate] [blame] [check-ins using] [diff]
19:42
Get rid of OFExceptions.h. file: [ae35beffef] check-in: [cda44767f4] user: js, branch: trunk, size: 2850 [annotate] [blame] [check-ins using] [diff]
2011-01-11
19:46
Windows calls it WSAENOTCONN. file: [57b1d6b16e] check-in: [e8c1757fb8] user: js, branch: trunk, size: 2769 [annotate] [blame] [check-ins using] [diff]
2011-01-08
16:05
Fix two FIXMEs. file: [62e35b4e2c] check-in: [202daae1d1] user: js, branch: trunk, size: 2661 [annotate] [blame] [check-ins using] [diff]
2011-01-01
20:19
Change license. file: [688fd9e6b1] check-in: [da6b3d26cb] user: js, branch: trunk, size: 2584 [annotate] [blame] [check-ins using] [diff]
2010-12-11
20:27
Rename a few exception-related methods. file: [66237703fc] check-in: [5e44debc07] user: js, branch: trunk, size: 2328 [annotate] [blame] [check-ins using] [diff]
2010-12-09
19:04
Move -[setBlocking] to OFStream. file: [fc3b5a9ea7] check-in: [beb4a0d036] user: js, branch: trunk, size: 2314 [annotate] [blame] [check-ins using] [diff]
2010-10-24
13:15
Rename a few methods returning BOOL. file: [a907635fe9] check-in: [b6a39dd3d1] user: js, branch: trunk, size: 2596 [annotate] [blame] [check-ins using] [diff]
2010-07-07
21:06
Move most of the code for -[close] to OFStreamSocket. file: [6a144d8c67] check-in: [d81629fead] user: js, branch: trunk, size: 2594 [annotate] [blame] [check-ins using] [diff]
20:57
Added: Rename OFSocket to OFStreamSocket.

This is to reflect that it is a connection-based, sequenced, reliable,
two-way byte stream. file: [1c776793df] check-in: [28ea4a8a67] user: js, branch: trunk, size: 2343 [annotate] [blame] [check-ins using]