| 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 patch class RawServerSocket { | 5 patch class RawServerSocket { |
| 6 /* patch */ static Future<RawServerSocket> bind([String address = "127.0.0.1", | 6 /* patch */ static Future<RawServerSocket> bind([String address = "127.0.0.1", |
| 7 int port = 0, | 7 int port = 0, |
| 8 int backlog = 0]) { | 8 int backlog = 0]) { |
| 9 return _RawServerSocket.bind(address, port, backlog); | 9 return _RawServerSocket.bind(address, port, backlog); |
| 10 } | 10 } |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 eventHandlers[ERROR_EVENT](e); | 388 eventHandlers[ERROR_EVENT](e); |
| 389 } | 389 } |
| 390 // For all errors we close the socket | 390 // For all errors we close the socket |
| 391 close(); | 391 close(); |
| 392 } | 392 } |
| 393 | 393 |
| 394 nativeAvailable() native "Socket_Available"; | 394 nativeAvailable() native "Socket_Available"; |
| 395 nativeRead(int len) native "Socket_Read"; | 395 nativeRead(int len) native "Socket_Read"; |
| 396 nativeWrite(List<int> buffer, int offset, int bytes) | 396 nativeWrite(List<int> buffer, int offset, int bytes) |
| 397 native "Socket_WriteList"; | 397 native "Socket_WriteList"; |
| 398 bool nativeCreateConnect(String host, int port) native "Socket_CreateConnect"; | 398 nativeCreateConnect(String host, int port) native "Socket_CreateConnect"; |
| 399 nativeCreateBindListen(String address, int port, int backlog) | 399 nativeCreateBindListen(String address, int port, int backlog) |
| 400 native "ServerSocket_CreateBindListen"; | 400 native "ServerSocket_CreateBindListen"; |
| 401 nativeAccept(_NativeSocket socket) native "ServerSocket_Accept"; | 401 nativeAccept(_NativeSocket socket) native "ServerSocket_Accept"; |
| 402 int nativeGetPort() native "Socket_GetPort"; | 402 int nativeGetPort() native "Socket_GetPort"; |
| 403 List nativeGetRemotePeer() native "Socket_GetRemotePeer"; | 403 List nativeGetRemotePeer() native "Socket_GetRemotePeer"; |
| 404 OSError nativeGetError() native "Socket_GetError"; | 404 OSError nativeGetError() native "Socket_GetError"; |
| 405 | 405 |
| 406 static SendPort newServicePort() native "Socket_NewServicePort"; | 406 static SendPort newServicePort() native "Socket_NewServicePort"; |
| 407 } | 407 } |
| 408 | 408 |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 921 _raw.onBadCertificate = callback; | 921 _raw.onBadCertificate = callback; |
| 922 } | 922 } |
| 923 | 923 |
| 924 X509Certificate get peerCertificate { | 924 X509Certificate get peerCertificate { |
| 925 if (_raw == null) { | 925 if (_raw == null) { |
| 926 throw new StateError("peerCertificate called on destroyed SecureSocket"); | 926 throw new StateError("peerCertificate called on destroyed SecureSocket"); |
| 927 } | 927 } |
| 928 return _raw.peerCertificate; | 928 return _raw.peerCertificate; |
| 929 } | 929 } |
| 930 } | 930 } |
| OLD | NEW |