summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-15 19:33:29 +0000
committerwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-15 19:33:29 +0000
commit347462e28144797eb7eeada2e9c167dcc29065f2 (patch)
tree3fefaf23002ba132fa9e8376a1f69e035efc22c6 /net
parentf0435d842d50df704629d4dd9bb3a7fed4d1ffa4 (diff)
downloadchromium_src-347462e28144797eb7eeada2e9c167dcc29065f2.zip
chromium_src-347462e28144797eb7eeada2e9c167dcc29065f2.tar.gz
chromium_src-347462e28144797eb7eeada2e9c167dcc29065f2.tar.bz2
Add a comment to document that we don't know if a nonblocking
connect will ever return 0, and therefore we don't know if the event object will be signaled in that case. R=rvargas http://crbug.com/9258 TEST=N/A Review URL: http://codereview.chromium.org/113474 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16171 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/base/tcp_client_socket_win.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/net/base/tcp_client_socket_win.cc b/net/base/tcp_client_socket_win.cc
index a3c0d03..7151aca 100644
--- a/net/base/tcp_client_socket_win.cc
+++ b/net/base/tcp_client_socket_win.cc
@@ -250,6 +250,17 @@ int TCPClientSocketWin::Connect(CompletionCallback* callback) {
if (!connect(socket_, ai->ai_addr, static_cast<int>(ai->ai_addrlen))) {
// Connected without waiting!
+ //
+ // The MSDN page for connect says:
+ // With a nonblocking socket, the connection attempt cannot be completed
+ // immediately. In this case, connect will return SOCKET_ERROR, and
+ // WSAGetLastError will return WSAEWOULDBLOCK.
+ // which implies that for a nonblocking socket, connect never returns 0.
+ // It's not documented whether the event object will be signaled or not
+ // if connect does return 0. So the code below is essentially dead code
+ // and we don't know if it's correct.
+ NOTREACHED();
+
if (ResetEventIfSignaled(core_->read_overlapped_.hEvent)) {
TRACE_EVENT_END("socket.connect", this, "");
return OK;