Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(372)

Unified Diff: runtime/bin/eventhandler_win.cc

Issue 9381003: Set SO_LINGER on sockets on windows. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/bin/socket_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/eventhandler_win.cc
diff --git a/runtime/bin/eventhandler_win.cc b/runtime/bin/eventhandler_win.cc
index 25e284c7d4e2ddaa7826a540f193ebd64f337855..b63da71084d998b671fa752c7208e19fdb78916f 100644
--- a/runtime/bin/eventhandler_win.cc
+++ b/runtime/bin/eventhandler_win.cc
@@ -394,6 +394,17 @@ void ListenSocket::AcceptComplete(IOBuffer* buffer, HANDLE completion_port) {
SO_UPDATE_ACCEPT_CONTEXT,
reinterpret_cast<char*>(&s), sizeof(s));
if (rc == NO_ERROR) {
+ linger l;
+ l.l_onoff = 1;
+ l.l_linger = 10;
+ int status = setsockopt(buffer->client(),
+ SOL_SOCKET,
+ SO_LINGER,
+ reinterpret_cast<char*>(&l),
+ sizeof(l));
+ if (status != NO_ERROR) {
+ FATAL("Failed setting SO_LINGER on socket");
+ }
// Insert the accepted socket into the list.
ClientSocket* client_socket = new ClientSocket(buffer->client(), 0);
client_socket->CreateCompletionPort(completion_port);
« no previous file with comments | « no previous file | runtime/bin/socket_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698