Reviewers: Erik Corry, Description: Allow the debugger agent to reuse ports stuck in TIME_WAIT for listening.
When the debugger agent terminates the used port can be stuck in TIME_WAIT for some time depending on the OS and the state of the socket. With this change will allow the debug agent to start listening on a port still in TIME_WAIT. During development of both V8 and embedding applications this makes it much easier to restart an application using the debugger agent. This also makes it possible to run the tests involving the debugger agent multiple times without failure. Please review this at http://codereview.chromium.org/50050 SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/ Affected files: M src/debug-agent.cc M test/cctest/test-debug.cc Index: test/cctest/test-debug.cc =================================================================== --- test/cctest/test-debug.cc (revision 1553) +++ test/cctest/test-debug.cc (working copy) @@ -3824,8 +3824,6 @@ } -// This test fails on some Linux versions - disabled for now. -#if 0 TEST(DebuggerAgent) { // Make sure this port is not used by other tests to allow tests to run in // parallel. @@ -3865,4 +3863,3 @@ delete server; } -#endif Index: src/debug-agent.cc =================================================================== --- src/debug-agent.cc (revision 1552) +++ src/debug-agent.cc (working copy) @@ -44,6 +44,9 @@ void DebuggerAgent::Run() { const int kOneSecondInMicros = 1000000; + // Allow this socket to reuse port even if still in TIME_WAIT. + server_->SetReuseAddress(true); + // First bind the socket to the requested port. bool bound = false; while (!bound && !terminate_) { --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---
