Add diagnostic print to debug agent if it fails to open port

Review URL: http://codereview.chromium.org/549061

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3621 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
peter.rybin@gmail.com 2010-01-15 18:11:12 +00:00
parent a3c0f20035
commit ccd760ae5d

View File

@ -54,10 +54,12 @@ void DebuggerAgent::Run() {
while (!bound && !terminate_) { while (!bound && !terminate_) {
bound = server_->Bind(port_); bound = server_->Bind(port_);
// If an error occoured wait a bit before retrying. The most common error // If an error occurred wait a bit before retrying. The most common error
// would be that the port is already in use so this avoids a busy loop and // would be that the port is already in use so this avoids a busy loop and
// make the agent take over the port when it becomes free. // make the agent take over the port when it becomes free.
if (!bound) { if (!bound) {
PrintF("Failed to open socket on port %d, "
"waiting %d ms before retrying\n", port_, kOneSecondInMicros / 1000);
terminate_now_->Wait(kOneSecondInMicros); terminate_now_->Wait(kOneSecondInMicros);
} }
} }