Skip to content

Commit

Permalink
correct socketoption struct and added ORBIS_NET_SO_SNDTIMEO
Browse files Browse the repository at this point in the history
  • Loading branch information
georgemoralis committed Jan 7, 2025
1 parent 2b4fba9 commit dbe8247
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/core/libraries/network/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,23 @@ enum OrbisNetSocketOption : u32 {
ORBIS_NET_SO_KEEPALIVE = 0x00000008,
ORBIS_NET_SO_BROADCAST = 0x00000020,
ORBIS_NET_SO_LINGER = 0x00000080,
ORBIS_NET_SO_OOBINLINE = 0x00000100,
ORBIS_NET_SO_REUSEPORT = 0x00000200,
ORBIS_NET_SO_ONESBCAST = 0x00000800,
ORBIS_NET_SO_USECRYPTO = 0x00001000,
ORBIS_NET_SO_USESIGNATURE = 0x00002000,
ORBIS_NET_SO_ONESBCAST = 0x00010000,
ORBIS_NET_SO_USECRYPTO = 0x00020000,
ORBIS_NET_SO_USESIGNATURE = 0x00040000,
ORBIS_NET_SO_SNDBUF = 0x1001,
ORBIS_NET_SO_RCVBUF = 0x1002,
ORBIS_NET_SO_SNDLOWAT = 0x1003,
ORBIS_NET_SO_RCVLOWAT = 0x1004,
ORBIS_NET_SO_SNDTIMEO = 0x1005,
ORBIS_NET_SO_RCVTIMEO = 0x1006,
ORBIS_NET_SO_ERROR = 0x1007,
ORBIS_NET_SO_TYPE = 0x1008,
ORBIS_NET_SO_NBIO = 0x1100,
ORBIS_NET_SO_TPPOLICY = 0x1101,
ORBIS_NET_SO_NAME = 0x1102
ORBIS_NET_SO_SNDTIMEO = 0x1105,
ORBIS_NET_SO_RCVTIMEO = 0x1106,
ORBIS_NET_SO_ERROR_EX = 0x1107,
ORBIS_NET_SO_ACCEPTTIMEO = 0x1108,
ORBIS_NET_SO_CONNECTTIMEO = 0x1109,
ORBIS_NET_SO_NBIO = 0x1200,
ORBIS_NET_SO_POLICY = 0x1201,
ORBIS_NET_SO_NAME = 0x1202,
ORBIS_NET_SO_PRIORITY = 0x1203
};

struct OrbisNetSockaddr {
Expand Down
2 changes: 2 additions & 0 deletions src/core/libraries/network/net_error.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// net errno codes

constexpr int ORBIS_NET_EBADF = 9;
constexpr int ORBIS_NET_EFAULT = 14;

// error codes
constexpr int ORBIS_NET_ERROR_EBADF = 0x80410109;
constexpr int ORBIS_NET_ERROR_EFAULT = 0x8041010e;
3 changes: 3 additions & 0 deletions src/core/libraries/network/posix_sockets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ int PosixSocket::SetSocketOptions(int level, int optname, const void* optval, un
case ORBIS_NET_SO_BROADCAST:
return ConvertReturnErrorCode(
setsockopt(sock, level, SO_BROADCAST, (const char*)optval, optlen));
case ORBIS_NET_SO_SNDTIMEO:
return ConvertReturnErrorCode(
setsockopt(sock, level, SO_SNDTIMEO, (const char*)optval, optlen));
}
}
UNREACHABLE_MSG("Unknown level ={} optname ={}", level, optname);
Expand Down

0 comments on commit dbe8247

Please sign in to comment.