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 #ifndef BIN_SOCKET_H_ | 5 #ifndef BIN_SOCKET_H_ |
6 #define BIN_SOCKET_H_ | 6 #define BIN_SOCKET_H_ |
7 | 7 |
8 #include "bin/builtin.h" | 8 #include "bin/builtin.h" |
9 #include "bin/utils.h" | 9 #include "bin/utils.h" |
10 #include "bin/dartutils.h" | 10 #include "bin/dartutils.h" |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 // Returns a positive integer if the call is successful. In case of failure | 296 // Returns a positive integer if the call is successful. In case of failure |
297 // it returns: | 297 // it returns: |
298 // | 298 // |
299 // -1: system error (errno set) | 299 // -1: system error (errno set) |
300 // -5: invalid bindAddress | 300 // -5: invalid bindAddress |
301 static intptr_t CreateBindListen(RawAddr addr, | 301 static intptr_t CreateBindListen(RawAddr addr, |
302 intptr_t port, | 302 intptr_t port, |
303 intptr_t backlog, | 303 intptr_t backlog, |
304 bool v6_only = false); | 304 bool v6_only = false); |
305 | 305 |
| 306 // Start accepting on a newly created listening socket. If it was unable to |
| 307 // start accepting incoming sockets, the fd is invalidated. |
| 308 static bool StartAccept(intptr_t fd); |
| 309 |
306 private: | 310 private: |
307 DISALLOW_ALLOCATION(); | 311 DISALLOW_ALLOCATION(); |
308 DISALLOW_IMPLICIT_CONSTRUCTORS(ServerSocket); | 312 DISALLOW_IMPLICIT_CONSTRUCTORS(ServerSocket); |
309 }; | 313 }; |
310 | 314 |
311 } // namespace bin | 315 } // namespace bin |
312 } // namespace dart | 316 } // namespace dart |
313 | 317 |
314 #endif // BIN_SOCKET_H_ | 318 #endif // BIN_SOCKET_H_ |
OLD | NEW |