| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "bin/dbg_connection.h" | 5 #include "bin/dbg_connection.h" |
| 6 #include "bin/dbg_message.h" | 6 #include "bin/dbg_message.h" |
| 7 #include "bin/dartutils.h" | 7 #include "bin/dartutils.h" |
| 8 #include "bin/log.h" | 8 #include "bin/log.h" |
| 9 #include "bin/socket.h" | 9 #include "bin/socket.h" |
| 10 #include "bin/thread.h" | 10 #include "bin/thread.h" |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 } | 370 } |
| 371 intptr_t bytes_written = | 371 intptr_t bytes_written = |
| 372 DebuggerConnectionImpl::Send(debug_fd, msg->buf(), msg->length()); | 372 DebuggerConnectionImpl::Send(debug_fd, msg->buf(), msg->length()); |
| 373 ASSERT(msg->length() == bytes_written); | 373 ASSERT(msg->length() == bytes_written); |
| 374 // TODO(hausner): Error checking. Probably just shut down the debugger | 374 // TODO(hausner): Error checking. Probably just shut down the debugger |
| 375 // session if we there is an error while writing. | 375 // session if we there is an error while writing. |
| 376 } | 376 } |
| 377 | 377 |
| 378 | 378 |
| 379 void DebuggerConnectionHandler::AcceptDbgConnection(int debug_fd) { | 379 void DebuggerConnectionHandler::AcceptDbgConnection(int debug_fd) { |
| 380 Socket::SetNoDelay(debug_fd, true); |
| 380 AddNewDebuggerConnection(debug_fd); | 381 AddNewDebuggerConnection(debug_fd); |
| 381 { | 382 { |
| 382 ASSERT(handler_lock_ != NULL); | 383 ASSERT(handler_lock_ != NULL); |
| 383 MonitorLocker ml(handler_lock_); | 384 MonitorLocker ml(handler_lock_); |
| 384 ml.NotifyAll(); | 385 ml.NotifyAll(); |
| 385 } | 386 } |
| 386 // TODO(asiva): Once we implement support for multiple connections | 387 // TODO(asiva): Once we implement support for multiple connections |
| 387 // we should have a different callback for wakeups on fds which | 388 // we should have a different callback for wakeups on fds which |
| 388 // are not the listener_fd_. | 389 // are not the listener_fd_. |
| 389 // In that callback we would lookup the handler object | 390 // In that callback we would lookup the handler object |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 | 455 |
| 455 | 456 |
| 456 bool DebuggerConnectionHandler::IsConnected() { | 457 bool DebuggerConnectionHandler::IsConnected() { |
| 457 // TODO(asiva): Support multiple debugger connections. | 458 // TODO(asiva): Support multiple debugger connections. |
| 458 // Return true if a connection has been established. | 459 // Return true if a connection has been established. |
| 459 return singleton_handler != NULL; | 460 return singleton_handler != NULL; |
| 460 } | 461 } |
| 461 | 462 |
| 462 } // namespace bin | 463 } // namespace bin |
| 463 } // namespace dart | 464 } // namespace dart |
| OLD | NEW |