| 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 "platform/globals.h" | 5 #include "platform/globals.h" |
| 6 #if defined(TARGET_OS_WINDOWS) | 6 #if defined(TARGET_OS_WINDOWS) |
| 7 | 7 |
| 8 #include "bin/dbg_connection.h" | 8 #include "bin/dbg_connection.h" |
| 9 | 9 |
| 10 #include "bin/eventhandler.h" | 10 #include "bin/eventhandler.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 FATAL("Accepting new debugger connection failed.\n"); | 21 FATAL("Accepting new debugger connection failed.\n"); |
| 22 } | 22 } |
| 23 ClientSocket* socket = new ClientSocket(client_socket); | 23 ClientSocket* socket = new ClientSocket(client_socket); |
| 24 DebuggerConnectionHandler::AcceptDbgConnection( | 24 DebuggerConnectionHandler::AcceptDbgConnection( |
| 25 reinterpret_cast<intptr_t>(socket)); | 25 reinterpret_cast<intptr_t>(socket)); |
| 26 } | 26 } |
| 27 | 27 |
| 28 | 28 |
| 29 void DebuggerConnectionImpl::StartHandler(int port_number) { | 29 void DebuggerConnectionImpl::StartHandler(int port_number) { |
| 30 ASSERT(DebuggerConnectionHandler::listener_fd_ != -1); | 30 ASSERT(DebuggerConnectionHandler::listener_fd_ != -1); |
| 31 int result = dart::Thread::Start(&DebuggerConnectionImpl::ThreadEntry, 0); | 31 int result = Thread::Start(&DebuggerConnectionImpl::ThreadEntry, 0); |
| 32 if (result != 0) { | 32 if (result != 0) { |
| 33 FATAL1("Failed to start debugger connection handler thread: %d\n", result); | 33 FATAL1("Failed to start debugger connection handler thread: %d\n", result); |
| 34 } | 34 } |
| 35 } | 35 } |
| 36 | 36 |
| 37 | 37 |
| 38 intptr_t DebuggerConnectionImpl::Send(intptr_t socket, | 38 intptr_t DebuggerConnectionImpl::Send(intptr_t socket, |
| 39 const char* buf, | 39 const char* buf, |
| 40 int len) { | 40 int len) { |
| 41 ClientSocket* client_socket = reinterpret_cast<ClientSocket*>(socket); | 41 ClientSocket* client_socket = reinterpret_cast<ClientSocket*>(socket); |
| 42 return send(client_socket->socket(), buf, len, 0); | 42 return send(client_socket->socket(), buf, len, 0); |
| 43 } | 43 } |
| 44 | 44 |
| 45 | 45 |
| 46 intptr_t DebuggerConnectionImpl::Receive(intptr_t socket, char* buf, int len) { | 46 intptr_t DebuggerConnectionImpl::Receive(intptr_t socket, char* buf, int len) { |
| 47 ClientSocket* client_socket = reinterpret_cast<ClientSocket*>(socket); | 47 ClientSocket* client_socket = reinterpret_cast<ClientSocket*>(socket); |
| 48 return recv(client_socket->socket(), buf, len, 0); | 48 return recv(client_socket->socket(), buf, len, 0); |
| 49 } | 49 } |
| 50 | 50 |
| 51 } // namespace bin | 51 } // namespace bin |
| 52 } // namespace dart | 52 } // namespace dart |
| 53 | 53 |
| 54 #endif // defined(TARGET_OS_WINDOWS) | 54 #endif // defined(TARGET_OS_WINDOWS) |
| OLD | NEW |