diff options
| author | Tetralux <tetraluxonpc@gmail.com> | 2023-08-26 11:25:37 +0000 |
|---|---|---|
| committer | Tetralux <tetraluxonpc@gmail.com> | 2023-08-26 11:47:03 +0000 |
| commit | e51915a529a4fafbf6f7a7ba469b475f5d1b9fba (patch) | |
| tree | cf632789ad84e0f2643f801ecae2202fc0e80d49 /core/net/errors_darwin.odin | |
| parent | d9a2d29d00bb2db32df41532fdb9af4e0381f3a7 (diff) | |
[net] Assorted cleanup
- Remove some old comments
- Fix some doc comments
- Improve some doc comments
- Unify name of the errors related to UDP packet sizes
(i.e: recv buffer too small, and message too big to send)
Diffstat (limited to 'core/net/errors_darwin.odin')
| -rw-r--r-- | core/net/errors_darwin.odin | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/core/net/errors_darwin.odin b/core/net/errors_darwin.odin index 39cf4c665..c80d2cf56 100644 --- a/core/net/errors_darwin.odin +++ b/core/net/errors_darwin.odin @@ -109,12 +109,12 @@ TCP_Recv_Error :: enum c.int { } UDP_Recv_Error :: enum c.int { - None = 0, - Truncated = c.int(os.EMSGSIZE), // The buffer is too small to fit the entire message, and the message was truncated. - Not_Socket = c.int(os.ENOTSOCK), // The so-called socket is not an open socket. - Not_Descriptor = c.int(os.EBADF), // The so-called socket is, in fact, not even a valid descriptor. - Bad_Buffer = c.int(os.EFAULT), // The buffer did not point to a valid location in memory. - Interrupted = c.int(os.EINTR), // A signal occurred before any data was transmitted. See signal(7). + None = 0, + Buffer_Too_Small = c.int(os.EMSGSIZE), // The buffer is too small to fit the entire message, and the message was truncated. When this happens, the rest of message is lost. + Not_Socket = c.int(os.ENOTSOCK), // The so-called socket is not an open socket. + Not_Descriptor = c.int(os.EBADF), // The so-called socket is, in fact, not even a valid descriptor. + Bad_Buffer = c.int(os.EFAULT), // The buffer did not point to a valid location in memory. + Interrupted = c.int(os.EINTR), // A signal occurred before any data was transmitted. See signal(7). // The send timeout duration passed before all data was sent. See Socket_Option.Send_Timeout. // NOTE: No, really. Presumably this means something different for nonblocking sockets... @@ -122,11 +122,9 @@ UDP_Recv_Error :: enum c.int { Socket_Not_Bound = c.int(os.EINVAL), // The socket must be bound for this operation, but isn't. } -// TODO TCP_Send_Error :: enum c.int { None = 0, - // TODO: merge with other errors? Aborted = c.int(os.ECONNABORTED), Connection_Closed = c.int(os.ECONNRESET), Not_Connected = c.int(os.ENOTCONN), @@ -151,7 +149,7 @@ TCP_Send_Error :: enum c.int { // TODO UDP_Send_Error :: enum c.int { None = 0, - Truncated = c.int(os.EMSGSIZE), // The message is too big. No data was sent. + Message_Too_Long = c.int(os.EMSGSIZE), // The message is larger than the maximum UDP packet size. No data was sent. // TODO: not sure what the exact circumstances for this is yet Network_Unreachable = c.int(os.ENETUNREACH), |