From: Igor Kulaychuk Date: Thu, 23 Aug 2018 18:05:40 +0000 (+0300) Subject: Enable ReadFile to block when reading from socket X-Git-Tag: accepted/tizen/unified/20180921.143126~2^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=316934d7f2f17ddcf52b25cee16bf600da426be2;p=sdk%2Ftools%2Fnetcoredbg.git Enable ReadFile to block when reading from socket --- diff --git a/src/debug/netcoredbg/platform.cpp b/src/debug/netcoredbg/platform.cpp index 3a940a6..90e0916 100644 --- a/src/debug/netcoredbg/platform.cpp +++ b/src/debug/netcoredbg/platform.cpp @@ -392,7 +392,10 @@ SOCKET IORedirectServerHandles::WaitForConnection(uint16_t port) return INVALID_SOCKET; } - m_sockFd = ::socket(AF_INET, SOCK_STREAM, 0); + // Use WSASocket with 0 flags to create a socket without FILE_FLAG_OVERLAPPED. + // This enables the ReadFile function to block on reading from accepted socket. + DWORD dwFlags = 0; + m_sockFd = WSASocket(AF_INET, SOCK_STREAM, 0, NULL, 0, dwFlags); if (m_sockFd == INVALID_SOCKET) { WSACleanup();