method TlsStream.read
Up to max bytes of application data. An empty result means the peer closed TLS cleanly (close_notify); a
connection that ended without it is Unavailable. A Timeout leaves the stream usable.
Example:
use std.net { TlsStream }
fn first(s: &TlsStream) -> bytes | NetError net {
s.read(4096, timeout: 2s)
}pub(api) fn read(max: usize, timeout: Duration? = none) -> bytes | NetError netС версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
max | usize |
timeout | Duration? = none |
Возвращает
bytes
Ошибки
NetError- `Timeout`, `Unavailable` (also: the peer ended without `close_notify`), `Cancelled`, `ProtocolError` (`tls alert:` ...).
Эффекты
net
Определено в: std/net/tls.oxl:262