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

Side by Side Diff: runtime/bin/dbg_connection.cc

Issue 14083007: Add new InternetAddress class with a static lookup function (including IPv6 results). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: cleanup from review. Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/bin/socket.h » ('j') | runtime/bin/socket.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 287
288 // Initialize the socket implementation. 288 // Initialize the socket implementation.
289 if (!Socket::Initialize()) { 289 if (!Socket::Initialize()) {
290 FATAL("Failed initializing socket implementation."); 290 FATAL("Failed initializing socket implementation.");
291 } 291 }
292 292
293 // Now setup a listener socket and start a thread which will 293 // Now setup a listener socket and start a thread which will
294 // listen, accept connections from debuggers, read and handle/dispatch 294 // listen, accept connections from debuggers, read and handle/dispatch
295 // debugger commands received on these connections. 295 // debugger commands received on these connections.
296 ASSERT(listener_fd_ == -1); 296 ASSERT(listener_fd_ == -1);
297 /*
298 FIXME
297 listener_fd_ = ServerSocket::CreateBindListen(address, port_number, 1); 299 listener_fd_ = ServerSocket::CreateBindListen(address, port_number, 1);
300 */
298 DebuggerConnectionImpl::StartHandler(port_number); 301 DebuggerConnectionImpl::StartHandler(port_number);
299 } 302 }
300 303
301 304
302 void DebuggerConnectionHandler::WaitForConnection() { 305 void DebuggerConnectionHandler::WaitForConnection() {
303 MonitorLocker ml(&handler_lock_); 306 MonitorLocker ml(&handler_lock_);
304 while (!IsConnected()) { 307 while (!IsConnected()) {
305 dart::Monitor::WaitResult res = ml.Wait(); 308 dart::Monitor::WaitResult res = ml.Wait();
306 ASSERT(res == dart::Monitor::kNotified); 309 ASSERT(res == dart::Monitor::kNotified);
307 } 310 }
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 ASSERT(singleton_handler != NULL); 434 ASSERT(singleton_handler != NULL);
432 return singleton_handler; 435 return singleton_handler;
433 } 436 }
434 437
435 438
436 bool DebuggerConnectionHandler::IsConnected() { 439 bool DebuggerConnectionHandler::IsConnected() {
437 // TODO(asiva): Support multiple debugger connections. 440 // TODO(asiva): Support multiple debugger connections.
438 // Return true if a connection has been established. 441 // Return true if a connection has been established.
439 return singleton_handler != NULL; 442 return singleton_handler != NULL;
440 } 443 }
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/socket.h » ('j') | runtime/bin/socket.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698