refactor(libSceNet): define timeout_option before receive_error

#4673 adds a function after receive_error, so defining timeout_option there made the two pull requests conflict.
This commit is contained in:
Yunus Shaikh 2026-10-12 11:52:49 -07:00
parent febc36223b
commit ac8106bda2
1 changed files with 6 additions and 6 deletions

View File

@ -381,6 +381,12 @@ std::int64_t message_length(const NetMsghdr* message) {
return static_cast<std::int64_t>(total);
}
int timeout_option(int optname) {
if (optname == NET_SO_SCE_SNDTIMEO) return NET_SO_SNDTIMEO;
if (optname == NET_SO_SCE_RCVTIMEO) return NET_SO_RCVTIMEO;
return optname;
}
int receive_error(const Sock& socket) {
#ifdef _WIN32
if (WSAGetLastError() == WSAETIMEDOUT && socket.type != NET_SOCK_STREAM && socket.rcv_timeout_us > 0) return NET_EAGAIN;
@ -390,12 +396,6 @@ int receive_error(const Sock& socket) {
return native_error();
}
int timeout_option(int optname) {
if (optname == NET_SO_SCE_SNDTIMEO) return NET_SO_SNDTIMEO;
if (optname == NET_SO_SCE_RCVTIMEO) return NET_SO_RCVTIMEO;
return optname;
}
} // namespace
extern "C" {