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

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

Issue 910183003: Reafctor to use 'const RawAddr&' or 'RawAddr*' in the eventhandler code (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minor change Created 5 years, 10 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/secure_socket.h » ('j') | runtime/bin/socket_linux.cc » ('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/lockers.h" 8 #include "bin/lockers.h"
9 #include "bin/log.h" 9 #include "bin/log.h"
10 #include "bin/socket.h" 10 #include "bin/socket.h"
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 FATAL("Failed initializing socket implementation."); 321 FATAL("Failed initializing socket implementation.");
322 } 322 }
323 323
324 // Now setup a listener socket and start a thread which will 324 // Now setup a listener socket and start a thread which will
325 // listen, accept connections from debuggers, read and handle/dispatch 325 // listen, accept connections from debuggers, read and handle/dispatch
326 // debugger commands received on these connections. 326 // debugger commands received on these connections.
327 ASSERT(listener_fd_ == -1); 327 ASSERT(listener_fd_ == -1);
328 OSError *os_error; 328 OSError *os_error;
329 AddressList<SocketAddress>* addresses = 329 AddressList<SocketAddress>* addresses =
330 Socket::LookupAddress(address, -1, &os_error); 330 Socket::LookupAddress(address, -1, &os_error);
331 listener_fd_ = ServerSocket::CreateBindListen( 331 RawAddr addr = addresses->GetAt(0)->addr();
332 addresses->GetAt(0)->addr(), port_number, 1); 332 SocketAddress::SetAddrPort(&addr, port_number);
333 listener_fd_ = ServerSocket::CreateBindListen(addr, 1);
333 delete addresses; 334 delete addresses;
334 if (listener_fd_ < 0) { 335 if (listener_fd_ < 0) {
335 fprintf(stderr, "%s", "Could not initialize debug socket\n"); 336 fprintf(stderr, "%s", "Could not initialize debug socket\n");
336 fflush(stderr); 337 fflush(stderr);
337 exit(255); 338 exit(255);
338 } 339 }
339 340
340 port_number = Socket::GetPort(listener_fd_); 341 port_number = Socket::GetPort(listener_fd_);
341 DebuggerConnectionImpl::StartHandler(port_number); 342 DebuggerConnectionImpl::StartHandler(port_number);
342 return port_number; 343 return port_number;
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 507
507 508
508 bool DebuggerConnectionHandler::IsConnected() { 509 bool DebuggerConnectionHandler::IsConnected() {
509 // TODO(asiva): Support multiple debugger connections. 510 // TODO(asiva): Support multiple debugger connections.
510 // Return true if a connection has been established. 511 // Return true if a connection has been established.
511 return singleton_handler != NULL; 512 return singleton_handler != NULL;
512 } 513 }
513 514
514 } // namespace bin 515 } // namespace bin
515 } // namespace dart 516 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/secure_socket.h » ('j') | runtime/bin/socket_linux.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698