mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-17 08:11:51 +00:00
Move connect workaround to connect interface
This commit is contained in:
parent
a6d8c4343f
commit
e2bced978e
@ -224,10 +224,12 @@ std::optional<s32> lv2_socket_native::connect(const sys_net_sockaddr& addr)
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
sys_net_error result = get_last_error(!so_nbio, was_connecting);
|
||||
#else
|
||||
sys_net_error result = get_last_error(!so_nbio);
|
||||
|
||||
#ifdef _WIN32
|
||||
// See https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-connect
|
||||
if (was_connecting && (result == SYS_NET_EINVAL || result == SYS_NET_EWOULDBLOCK))
|
||||
return -SYS_NET_EALREADY;
|
||||
#endif
|
||||
|
||||
if (result)
|
||||
|
@ -93,10 +93,6 @@ sys_net_error convert_error(bool is_blocking, int native_error, [[maybe_unused]]
|
||||
// Windows will return SYS_NET_ENOTCONN when recvfrom/sendto is called on a socket that is connecting but not yet connected
|
||||
if (result == SYS_NET_ENOTCONN)
|
||||
return SYS_NET_EAGAIN;
|
||||
|
||||
// See https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-connect
|
||||
if (result == SYS_NET_EINVAL || result == SYS_NET_EWOULDBLOCK)
|
||||
return SYS_NET_EALREADY;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user