From f7af0b8d5256c68c5914510e0f0f02dc2b56da5a Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Thu, 21 Oct 2021 06:51:49 -0700 Subject: [PATCH] Adding more logging to debug TcpSocket on Jenkins machine Signed-off-by: Gene Walters --- .../AzNetworking/TcpTransport/TcpSocket.cpp | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpSocket.cpp b/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpSocket.cpp index e469b70640..f3b62e1913 100644 --- a/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpSocket.cpp +++ b/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpSocket.cpp @@ -68,14 +68,31 @@ namespace AzNetworking { Close(); - if (!SocketCreateInternal() - || !BindSocketForConnectInternal(address) - || !(SetSocketNonBlocking(m_socketFd) && SetSocketNoDelay(m_socketFd))) + if (!SocketCreateInternal()) { + AZ_Warning("TcpSocket", false, "Tcp::Connect failed. SocketCreateInternal is false"); + Close(); return false; } + if (!BindSocketForConnectInternal(address)) + { + AZ_Warning("TcpSocket", false, "Tcp::Connect failed. BindSocketForConnectInternal is false"); + + Close(); + return false; + } + + if (!(SetSocketNonBlocking(m_socketFd) && SetSocketNoDelay(m_socketFd))) + { + AZ_Warning("TcpSocket", false, "Tcp::Connect failed. SetSocketNonBlocking and SetSocketNoDelay is false"); + + Close(); + return false; + } + + return true; }