Types
BufferStream = ref object of Connection readQueue*: AsyncQueue[seq[byte]] readBuf*: StreamSeq pushing*: bool reading*: bool pushedEof*: bool returnedEof*: bool
- Source Edit
Consts
BufferStreamTrackerName = "BufferStream"
- Source Edit
Procs
proc len(s: BufferStream): int {....raises: [], tags: [].}
- Source Edit
proc new(T: typedesc[BufferStream]; timeout: Duration = DefaultConnectionTimeout): T:type {. ...raises: [].}
- Source Edit
func shortLog(s: BufferStream): auto {....raises: [], tags: [].}
- Source Edit
Methods
method atEof(s: BufferStream): bool {....raises: [], tags: [].}
- Source Edit
method closeImpl(s: BufferStream): Future[void] {....raises: [], tags: [RootEffect].}
- close the stream and clear the buffer Source Edit
method initStream(s: BufferStream) {....raises: [], tags: [RootEffect, TimeEffect].}
- Source Edit
method pushData(s: BufferStream; data: seq[byte]): Future[void] {.base, stackTrace: false, ...gcsafe, raises: [], raises: [], raises: [], tags: [RootEffect].}
-
Write bytes to internal read buffer, use this to fill up the buffer with data.
pushTo will block if the queue is full, thus maintaining backpressure.
Source Edit method pushEof(s: BufferStream): Future[void] {.base, stackTrace: false, ...gcsafe, raises: [], raises: [], raises: [], tags: [RootEffect].}
- Source Edit
method readOnce(s: BufferStream; pbytes: pointer; nbytes: int): Future[int] {. stackTrace: false, ...gcsafe, raises: [], raises: [], raises: [], tags: [RootEffect].}
- Source Edit
Templates
template formatItIMPL(it: BufferStream): auto
- Source Edit
Exports
-
newLPStreamWriteError, DNS_OR_IP, shortLog, init, random, UDP_DNS, $, <=, MaError, ephemeral, decode, MaPatternOp, ==, WS_DNS, initVBuffer, getProtoHeader, MaxSizeError, decodeProposal, ProtoFlags, ==, getLen, ECDHEScheme, shortLog, init, closed, [], macOpenArray, random, init, Secret, peekVarint, random, $, validate, mapOr, init, bytes, maxInlineKeyLength, TranscoderDNS, QUIC, [], init, getRequiredField, getField, init, supported, WS_IP, write, public, MAKind, getBytes, write, init, getField, checkFieldNumber, key, getRepeatedField, matchPartial, getBytes, len, readLp, HTTP, initVBuffer, atEof, LPStreamTrackerName, peekSeq, fullAddrs, payloadType, getProtoHeader, LPStreamError, init, IP, protoAddress, newRng, DefaultConnectionTimeout, checkValid, getPublicKey, exceptionToAssert, ProtoHeader, len, CircuitRelay, extractPublicKey, mapAnd, new, verify, UDP_IP, new, newLPStreamEOFError, init, ==, DNSADDR, AddressMapper, readVarint, write, WSS, LPStream, TCP_IP, close, writePacked, init, init, closeImpl, readSeq, toBytes, TCP_DNS, shortLog, encode, TranscoderIP4, init, protoName, ==, toRawBytes, TranscoderIP6Zone, initProtoBuffer, newLPStreamReadError, ProtoBuffer, WSS_DNS, match, writeLPVarint, CryptoResult, ProtoResult, WebRTCDirect, init, init, UDP, TranscoderOnion, StreamTracker, write, init, LPStreamResetError, isEmpty, writeArray, writeLp, parseFullAddress, LPStreamIncompleteError, PeerId, [], LPStreamEOFError, IP6, shortLog, initVBuffer, PKScheme, init, payload, init, stretchKeys, Connection, write, init, TCP, PrivateKey, getBytes, write, init, &=, PeerInfoError, newLPStreamClosedError, random, compilesOr, init, $, initProtoBuffer, toException, DNS, readVarint, init, UTP, goffset, >, KeyPair, finish, init, high, toString, init, cmp, init, SupportedWireTypes, formatItIMPL, formatItIMPL, formatItIMPL, Signature, formatItIMPL, toBytes, DigestSheme, IPFS, getField, readOnce, libp2p_pki_schemes, isEmpty, ProtoScalar, shortLog, LPStreamIncorrectDefect, hex, protocols, hash, HTTPS, tryAndWarn, hash, WebSockets, LPError, getPtr, write, sign, encode, update, MaResult, ProtoField, TimeoutHandler, toBytes, writeSeq, &, DNS6, IpTransportProtocol, toOpenArray, allFuturesThrowing, IP4, TranscoderPort, isEnough, safeConvert, getField, createExchange, >=, init, mac, ephemeral, payloadDomain, $, getRawBytes, init, LPStreamLimitError, TranscoderOnion3, SignedPayload, init, toBytes, protoArgument, newLPStreamLimitError, newLPStreamIncorrectDefect, keyOpenArray, match, createProposal, parseFullAddress, $, isEmpty, LPStreamReadError, getRequiredRepeatedField, init, newLPStreamIncompleteError, newLPStreamReadError, write, initProtoBuffer, MAProtocol, newLPStreamResetError, decode, getPackedRepeatedField, initStream, contains, init, shortLog, DNS4, data, getWrapped, readArray, selectBest, write, P2PPattern, Envelope, hasPublicKey, toException, init, isEnough, init, Reliable, addrs, hex, closeImpl, write, WS, init, encode, DNSANY, getField, match, getField, <, iv, readLine, Eof, CryptoError, getField, hash, append, MaPattern, vsizeof, init, WebSockets_DNS, WSS_IP, LPStreamConnDownError, peekArray, UNIX, PeerRecord, SupportedSchemes, getRepeatedField, LPStreamWriteError, getField, Unreliable, SupportedSchemesInt, random, checkFutures, shuffle, validate, $, protoCode, mapEq, getField, init, Onion3, write, TcpOnion3, concat, TranscoderP2P, PeerInfo, AddressInfo, ConnectionTrackerName, TranscoderIP6, write, EnvelopeError, encode, len, newLPStreamRemoteClosedError, MaPatResult, Direction, init, InvalidVarintError, shortLog, write, getBytes, write, finish, PublicKey, WebSockets_IP, VBuffer, writeLp, decode, writePBVarint, ProtoFieldKind, readExactly, protoArgument, getRepeatedField, ProtoError, newLPStreamConnDownError, initStream, MultiAddress, ivOpenArray, closeWithEOF, orError, decodeExchange, getField, LPStreamRemoteClosedError, setupStreamTracker, MaInvalidAddress, LPStreamClosedError, RsaDefaultKeySize, items, write, getOrder, TranscoderUnix, SignedPeerRecord, join, writeVarint