Author: [email protected]
Date: Fri Mar 20 02:03:36 2009
New Revision: 1558

Modified:
    branches/bleeding_edge/src/debug-agent.cc
    branches/bleeding_edge/test/cctest/test-debug.cc

Log:
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.
Review URL: http://codereview.chromium.org/50050

Modified: branches/bleeding_edge/src/debug-agent.cc
==============================================================================
--- branches/bleeding_edge/src/debug-agent.cc   (original)
+++ branches/bleeding_edge/src/debug-agent.cc   Fri Mar 20 02:03:36 2009
@@ -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_) {

Modified: branches/bleeding_edge/test/cctest/test-debug.cc
==============================================================================
--- branches/bleeding_edge/test/cctest/test-debug.cc    (original)
+++ branches/bleeding_edge/test/cctest/test-debug.cc    Fri Mar 20 02:03:36  
2009
@@ -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

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to