| OLD | NEW |
| 1 // Copyright (c) 2014, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dartino 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
| 4 | 4 |
| 5 /// Socket access. Only supported when Dartino is running on a Posix platform. | 5 /// Socket access. Only supported when Dartino is running on a Posix platform. |
| 6 /// | 6 /// |
| 7 /// Reporting issues | 7 /// Reporting issues |
| 8 /// ---------------- | 8 /// ---------------- |
| 9 /// Please file an issue [in the issue | 9 /// Please file an issue [in the issue |
| 10 /// tracker](https://github.com/dartino/sdk/issues/new?title=Add%20title&labels=
Area-Package&body=%3Cissue%20description%3E%0A%3Crepro%20steps%3E%0A%3Cexpected%
20outcome%3E%0A%3Cactual%20outcome%3E). | 10 /// tracker](https://github.com/dartino/sdk/issues/new?title=Add%20title&labels=
Area-Package&body=%3Cissue%20description%3E%0A%3Crepro%20steps%3E%0A%3Cexpected%
20outcome%3E%0A%3Cactual%20outcome%3E). |
| 11 library socket; | 11 library socket; |
| 12 | 12 |
| 13 import 'dart:fletch'; | 13 import 'dart:dartino'; |
| 14 import 'dart:fletch.os' as os; | 14 import 'dart:dartino.os' as os; |
| 15 import 'dart:typed_data'; | 15 import 'dart:typed_data'; |
| 16 import 'dart:fletch.ffi' show Struct32, ForeignMemory; | 16 import 'dart:dartino.ffi' show Struct32, ForeignMemory; |
| 17 | 17 |
| 18 import 'package:os/os.dart'; | 18 import 'package:os/os.dart'; |
| 19 | 19 |
| 20 class _SocketBase { | 20 class _SocketBase { |
| 21 int _fd = -1; | 21 int _fd = -1; |
| 22 Channel _channel; | 22 Channel _channel; |
| 23 Port _port; | 23 Port _port; |
| 24 | 24 |
| 25 _SocketBase() { | 25 _SocketBase() { |
| 26 _channel = new Channel(); | 26 _channel = new Channel(); |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 } | 294 } |
| 295 } | 295 } |
| 296 | 296 |
| 297 class SocketException implements Exception { | 297 class SocketException implements Exception { |
| 298 final String message; | 298 final String message; |
| 299 final int errno; | 299 final int errno; |
| 300 SocketException(this.message, this.errno); | 300 SocketException(this.message, this.errno); |
| 301 | 301 |
| 302 String toString() => "SocketException: $message, $errno"; | 302 String toString() => "SocketException: $message, $errno"; |
| 303 } | 303 } |
| OLD | NEW |