| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 #if !defined(DART_IO_DISABLED) | 5 #if !defined(DART_IO_DISABLED) |
| 6 | 6 |
| 7 #include "platform/globals.h" | 7 #include "platform/globals.h" |
| 8 #if defined(HOST_OS_WINDOWS) | 8 #if defined(HOST_OS_WINDOWS) |
| 9 | 9 |
| 10 #include "bin/socket_base.h" | 10 #include "bin/socket_base.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 167 |
| 168 | 168 |
| 169 intptr_t SocketBase::GetStdioHandle(intptr_t num) { | 169 intptr_t SocketBase::GetStdioHandle(intptr_t num) { |
| 170 if (num != 0) { | 170 if (num != 0) { |
| 171 return -1; | 171 return -1; |
| 172 } | 172 } |
| 173 HANDLE handle = GetStdHandle(STD_INPUT_HANDLE); | 173 HANDLE handle = GetStdHandle(STD_INPUT_HANDLE); |
| 174 if (handle == INVALID_HANDLE_VALUE) { | 174 if (handle == INVALID_HANDLE_VALUE) { |
| 175 return -1; | 175 return -1; |
| 176 } | 176 } |
| 177 <<<<<<< HEAD | |
| 178 StdHandle* std_handle = StdHandle::Stdin(handle); | 177 StdHandle* std_handle = StdHandle::Stdin(handle); |
| 179 std_handle->Retain(); | 178 std_handle->Retain(); |
| 180 ======= | |
| 181 StdHandle* std_handle = new StdHandle(handle); | |
| 182 >>>>>>> Revert "Reverting until bots clear up." | |
| 183 std_handle->MarkDoesNotSupportOverlappedIO(); | 179 std_handle->MarkDoesNotSupportOverlappedIO(); |
| 184 std_handle->EnsureInitialized(EventHandler::delegate()); | 180 std_handle->EnsureInitialized(EventHandler::delegate()); |
| 185 return reinterpret_cast<intptr_t>(std_handle); | 181 return reinterpret_cast<intptr_t>(std_handle); |
| 186 } | 182 } |
| 187 | 183 |
| 188 | 184 |
| 189 <<<<<<< HEAD | |
| 190 ======= | |
| 191 intptr_t ServerSocket::Accept(intptr_t fd) { | |
| 192 ListenSocket* listen_socket = reinterpret_cast<ListenSocket*>(fd); | |
| 193 ClientSocket* client_socket = listen_socket->Accept(); | |
| 194 if (client_socket != NULL) { | |
| 195 return reinterpret_cast<intptr_t>(client_socket); | |
| 196 } else { | |
| 197 return -1; | |
| 198 } | |
| 199 } | |
| 200 | |
| 201 | |
| 202 >>>>>>> Revert "Reverting until bots clear up." | |
| 203 AddressList<SocketAddress>* SocketBase::LookupAddress(const char* host, | 185 AddressList<SocketAddress>* SocketBase::LookupAddress(const char* host, |
| 204 int type, | 186 int type, |
| 205 OSError** os_error) { | 187 OSError** os_error) { |
| 206 Initialize(); | 188 Initialize(); |
| 207 | 189 |
| 208 // Perform a name lookup for a host name. | 190 // Perform a name lookup for a host name. |
| 209 struct addrinfo hints; | 191 struct addrinfo hints; |
| 210 memset(&hints, 0, sizeof(hints)); | 192 memset(&hints, 0, sizeof(hints)); |
| 211 hints.ai_family = SocketAddress::FromType(type); | 193 hints.ai_family = SocketAddress::FromType(type); |
| 212 hints.ai_socktype = SOCK_STREAM; | 194 hints.ai_socktype = SOCK_STREAM; |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 return setsockopt(handle->socket(), proto, MCAST_LEAVE_GROUP, | 446 return setsockopt(handle->socket(), proto, MCAST_LEAVE_GROUP, |
| 465 reinterpret_cast<char*>(&mreq), sizeof(mreq)) == 0; | 447 reinterpret_cast<char*>(&mreq), sizeof(mreq)) == 0; |
| 466 } | 448 } |
| 467 | 449 |
| 468 } // namespace bin | 450 } // namespace bin |
| 469 } // namespace dart | 451 } // namespace dart |
| 470 | 452 |
| 471 #endif // defined(HOST_OS_WINDOWS) | 453 #endif // defined(HOST_OS_WINDOWS) |
| 472 | 454 |
| 473 #endif // !defined(DART_IO_DISABLED) | 455 #endif // !defined(DART_IO_DISABLED) |
| OLD | NEW |