OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 part of dart.io; | 5 part of dart.io; |
6 | 6 |
7 /** | 7 /** |
8 * A low-level class for communicating synchronously over a TCP socket. | 8 * A low-level class for communicating synchronously over a TCP socket. |
9 * | 9 * |
10 * Warning: [RawSynchronousSocket] should probably only be used to connect to | 10 * Warning: [RawSynchronousSocket] should probably only be used to connect to |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 * sent by the socket. [bytes] specifies the maximum number of bytes to | 61 * sent by the socket. [bytes] specifies the maximum number of bytes to |
62 * be read. Returns the list of bytes read, which could be less than the | 62 * be read. Returns the list of bytes read, which could be less than the |
63 * value specified by [bytes]. | 63 * value specified by [bytes]. |
64 */ | 64 */ |
65 List<int> readSync(int bytes); | 65 List<int> readSync(int bytes); |
66 | 66 |
67 /** | 67 /** |
68 * Shutdown a socket in the provided direction. | 68 * Shutdown a socket in the provided direction. |
69 * | 69 * |
70 * Calling shutdown will never throw an exception and calling it several times | 70 * Calling shutdown will never throw an exception and calling it several times |
71 * is supported. If both [RECEIVE] and [SEND] directions are closed, the | 71 * is supported. If both [SocketDirection.RECEIVE] and [SocketDirection.SEND] |
72 * socket is closed completely, the same as if [closeSync] has been called. | 72 * directions are closed, the socket is closed completely, the same as if |
| 73 * [closeSync] has been called. |
73 */ | 74 */ |
74 void shutdown(SocketDirection direction); | 75 void shutdown(SocketDirection direction); |
75 | 76 |
76 /** | 77 /** |
77 * Writes data from a specified range in a [List<int>] to the socket. | 78 * Writes data from a specified range in a [List<int>] to the socket. |
78 * | 79 * |
79 * Writes into the socket from a [List<int>]. If [start] is present, the bytes | 80 * Writes into the socket from a [List<int>]. If [start] is present, the bytes |
80 * will be written to the socket starting from index [start]. If [start] is | 81 * will be written to the socket starting from index [start]. If [start] is |
81 * not present, the bytes will be written starting from index 0. If [end] is | 82 * not present, the bytes will be written starting from index 0. If [end] is |
82 * present, the [end] - [start] bytes will be written into the socket starting | 83 * present, the [end] - [start] bytes will be written into the socket starting |
(...skipping 16 matching lines...) Expand all Loading... |
99 /** | 100 /** |
100 * The [InternetAddress] used to connect this socket. | 101 * The [InternetAddress] used to connect this socket. |
101 */ | 102 */ |
102 InternetAddress get address; | 103 InternetAddress get address; |
103 | 104 |
104 /** | 105 /** |
105 * The remote [InternetAddress] connected to by this socket. | 106 * The remote [InternetAddress] connected to by this socket. |
106 */ | 107 */ |
107 InternetAddress get remoteAddress; | 108 InternetAddress get remoteAddress; |
108 } | 109 } |
OLD | NEW |