Skip to content

Commit

Permalink
added case in SetSocketOptions for tony hawk 5
Browse files Browse the repository at this point in the history
  • Loading branch information
georgemoralis committed Jan 10, 2025
1 parent 0744268 commit e871518
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/core/libraries/network/posix_sockets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ int PosixSocket::SetSocketOptions(int level, int optname, const void* optval, un
case ORBIS_NET_SO_SNDTIMEO:
return ConvertReturnErrorCode(
setsockopt(sock, level, SO_SNDTIMEO, (const char*)optval, optlen));
case ORBIS_NET_SO_ONESBCAST: {
if (optlen != sizeof(sockopt_so_onesbcast)) {
return ORBIS_NET_ERROR_EFAULT;
}
memcpy(&sockopt_so_onesbcast, optval, optlen);
return 0;
}
case ORBIS_NET_SO_NBIO: {
if (optlen != sizeof(sockopt_so_nbio)) {
return ORBIS_NET_ERROR_EFAULT;
Expand Down
1 change: 1 addition & 0 deletions src/core/libraries/network/sockets.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ struct Socket {
struct PosixSocket : public Socket {
net_socket sock;
int sockopt_so_nbio = 0;
int sockopt_so_onesbcast = 0;
explicit PosixSocket(int domain, int type, int protocol)
: Socket(domain, type, protocol), sock(socket(domain, type, protocol)) {}
int SetSocketOptions(int level, int optname, const void* optval, unsigned int optlen) override;
Expand Down

0 comments on commit e871518

Please sign in to comment.