Merge pull request #14395 from sepalani/tri-connect

AMMediaboard: Add more connect log messages
This commit is contained in:
Jordan Woyak authored and GitHub committed 2026-02-20 19:25:59 -06:00
commit ddedae327f
1 file changed
+7 -1
+7 -1
View File
@@ -743,9 +743,11 @@ static s32 NetDIMMConnect(GuestSocket guest_socket, const GuestSocketAddress& gu
WSAPOLLFD pfds[1]{{.fd = host_socket, .events = POLLOUT}}; WSAPOLLFD pfds[1]{{.fd = host_socket, .events = POLLOUT}};
// TODO: Possible race between this socket's SetTimeOuts and others'
const auto timeout = const auto timeout =
duration_cast<std::chrono::milliseconds>(std::chrono::microseconds{s_timeouts[0]}); duration_cast<std::chrono::milliseconds>(std::chrono::microseconds{s_timeouts[0]});
// TODO: Might block if timeout is too big
const int poll_result = PlatformPoll(pfds, timeout); const int poll_result = PlatformPoll(pfds, timeout);
if (poll_result < 0) [[unlikely]] if (poll_result < 0) [[unlikely]]
@@ -757,7 +759,7 @@ static s32 NetDIMMConnect(GuestSocket guest_socket, const GuestSocketAddress& gu
return SOCKET_ERROR; return SOCKET_ERROR;
} }
if ((pfds[0].revents & POLLOUT) == 0) if ((pfds[0].revents & (POLLOUT | POLLERR)) == 0)
{ {
// Timeout. // Timeout.
s_last_error = SSC_EWOULDBLOCK; s_last_error = SSC_EWOULDBLOCK;
@@ -776,10 +778,14 @@ static s32 NetDIMMConnect(GuestSocket guest_socket, const GuestSocketAddress& gu
} }
else if (so_error == 0) else if (so_error == 0)
{ {
INFO_LOG_FMT(AMMEDIABOARD_NET, "NetDIMMConnect: connect( {}({}) ) succeeded", host_socket,
u32(guest_socket));
s_last_error = SSC_SUCCESS; s_last_error = SSC_SUCCESS;
return 0; return 0;
} }
ERROR_LOG_FMT(AMMEDIABOARD_NET, "NetDIMMConnect: connect( {}({}) ) failed with error {}: {}",
host_socket, u32(guest_socket), so_error, Common::DecodeNetworkError(so_error));
s_last_error = SOCKET_ERROR; s_last_error = SOCKET_ERROR;
return SOCKET_ERROR; return SOCKET_ERROR;
} }