libp2p/stream/connection

Search:
Group by:
Source   Edit  

Types

Connection = ref object of LPStream
  activity*: bool
  timeout*: Duration
  timeoutHandler*: TimeoutHandler
  peerId*: PeerId
  observedAddr*: Opt[MultiAddress]
  localAddr*: Opt[MultiAddress]
  protocol*: string
  transportDir*: Direction
  when defined(libp2p_agents_metrics):
    shortAgent*: string
Source   Edit  
libp2p_network_bytes = IgnoredCollector
Source   Edit  
TimeoutHandler = proc (): Future[void] {.async: (...raises: []).}
Source   Edit  

Consts

ConnectionTrackerName = "Connection"
Source   Edit  
DefaultConnectionTimeout = (value: 300000000000)
Source   Edit  

Procs

func hash(p: Connection): Hash {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc new(C: type Connection; peerId: PeerId; dir: Direction;
         observedAddr: Opt[MultiAddress] = Opt.none(MultiAddress);
         localAddr: Opt[MultiAddress] = Opt.none(MultiAddress);
         timeout: Duration = DefaultConnectionTimeout;
         timeoutHandler: TimeoutHandler = nil): Connection {....raises: [].}
Source   Edit  
func shortLog(conn: Connection): string {....raises: [], tags: [], forbids: [].}
Source   Edit  

Methods

method closeImpl(s: Connection): InternalRaisesFuture[void, void] {.
    ...stackTrace: false, raises: [], gcsafe, raises: [], tags: [RootEffect],
    forbids: [].}
Source   Edit  
method closeWrite(s: Connection): InternalRaisesFuture[void, void] {.base,
    ...stackTrace: false, raises: [], gcsafe, raises: [], tags: [RootEffect],
    forbids: [].}
Close the write side of the connection Subclasses should implement this for their specific transport Default implementation just closes the entire connection Source   Edit  
method getWrapped(s: Connection): Connection {.base, ...raises: [], tags: [],
    forbids: [].}
Source   Edit  
method initStream(s: Connection) {....raises: [], tags: [TimeEffect, RootEffect],
                                   forbids: [].}
Source   Edit  

Templates

template formatItIMPL(it: Connection): auto {..}
Source   Edit  

Exports

InvalidVarintError, atEof, newLPStreamIncompleteError, writeLp, initStream, formatItIMPL, newLPStreamResetError, readVarint, LPStreamError, closeWithEOF, newLPStreamLimitError, join, LPStreamResetError, write, Eof, newLPStreamClosedError, LPStreamIncompleteError, close, LPStreamRemoteClosedError, readLp, LPStreamEOFError, LPStreamTrackerName, shortLog, LPStreamConnDownError, LPStreamLimitError, readOnce, toException, toException, LPStream, LPStreamClosedError, newLPStreamEOFError, StreamTracker, MaxSizeError, write, closeImpl, writeLp, newLPStreamRemoteClosedError, checkFutures, readLine, Direction, readExactly, newLPStreamConnDownError, closed, LPError, shortLog, UDP_DNS, ephemeral, init, MaPatternOp, ==, <=, filterIt, shortLog, init, $, validate, init, Memory, TLS_WS, TranscoderDNS, ephemeral, MAKind, init, getRepeatedField, getBytes, len, &, peekSeq, fullAddrs, init, QUIC_V1_IP, withValue, getPublicKey, getPart, new, DNSANY, DNSADDR, AddressMapper, WSS, init, toBytes, TCP_DNS, shortLog, encode, len, supported, init, ==, $, WSS_DNS, <, $, PeerInfo, TranscoderOnion, write, key, writeArray, IP6, shortLog, payload, stretchKeys, TCP, PrivateKey, getBytes, init, &=, TranscoderMemory, init, $, getRawBytes, KeyPair, init, isEmpty, data, HTTPS, QUIC_DNS, TranscoderIP6, encode, MaResult, finish, DNS6, expandAddrs, [], IpTransportProtocol, TranscoderPort, >=, init, payloadDomain, $, init, TranscoderOnion3, protoArgument, keyOpenArray, match, WebSockets_DNS, isEmpty, QUIC_V1_DNS, getField, selectBest, Envelope, init, init, Reliable, addrs, init, getField, match, CryptoError, append, init, parseFullAddress, checkFutures, shuffle, init, validate, protoCode, TranscoderP2P, sign, getBytes, encode, WebSockets, TranscoderIP6Zone, shortLog, items, getBytes, init, QUIC_IP, protoArgument, readVarint, orError, MaInvalidAddress, getOrder, hash, TranscoderUnix, SignedPeerRecord, writeVarint, DNS_OR_IP, init, random, MaError, decode, matchPartial, WS_DNS, initVBuffer, ECDHEScheme, init, [], decode, decode, random, Secret, peekVarint, random, mapOr, bytes, maxInlineKeyLength, QUIC, withValue, mac, WS_IP, public, write, valueOr, libp2p_pki_schemes, areAddrsConsistent, init, HTTP, initVBuffer, TcpOnion3, write, toOpt, payloadType, $, IP, protoAddress, newRng, checkValid, len, CircuitRelay, extractPublicKey, mapAnd, maErr, UDP_IP, init, ==, write, PeerId, QUIC_V1, TCP_IP, readSeq, capLen, protoName, toRawBytes, MaPattern, toException, match, writeLPVarint, CryptoResult, parseFullAddress, WebRTCDirect, init, UDP, init, initVBuffer, PKScheme, random, write, init, write, PeerInfoError, compilesOr, TranscoderIP4, toException, DNS, init, goffset, >, high, toString, init, cmp, init, formatItIMPL, formatItIMPL, Signature, exclIfIt, toBytes, DigestSheme, IPFS, getField, MultiAddress, hex, protocols, UNIX, LPError, init, toBytes, writeSeq, init, ==, VBuffer, init, [], IP4, safeConvert, getField, init, withValue, SignedPayload, toBytes, init, MAProtocol, contains, DNS4, readArray, P2PPattern, hasPublicKey, isEnough, hex, WS, encode, init, init, getField, iv, WSS_IP, peekArray, PeerRecord, SupportedSchemes, getField, hash, Unreliable, SupportedSchemesInt, random, macOpenArray, mapEq, Onion3, concat, AddressInfo, write, EnvelopeError, MaPatResult, init, write, write, UTP, verify, PublicKey, WebSockets_IP, writePBVarint, ivOpenArray, RsaDefaultKeySize, write, update, toException, toException, checkFutures, LPError