libp2p/transports/tcptransport

    Dark Mode
Search:
Group by:
  Source   Edit

TCP transport implementation

Types

TcpTransport = ref object of Transport
  servers*: seq[StreamServer]
  clients: array[Direction, seq[StreamTransport]]
  flags: set[ServerFlags]
  clientFlags: set[SocketFlags]
  acceptFuts: seq[AcceptFuture]
  connectionsTimeout: Duration
  stopping: bool
  Source   Edit
TcpTransportError = object of transport.TransportError
  Source   Edit

Consts

TcpTransportTrackerName = "libp2p.tcptransport"
  Source   Edit

Procs

proc connHandler(self: TcpTransport; client: StreamTransport;
                 observedAddr: Opt[MultiAddress]; dir: Direction): Connection {.
    ...raises: [], tags: [TimeEffect, RootEffect].}
  Source   Edit
proc new(T: typedesc[TcpTransport]; flags: set[ServerFlags] = {};
         upgrade: Upgrade; connectionsTimeout = 10.minutes): T:type {.public,
    ...raises: [].}
  Source   Edit

Methods

method accept(self: TcpTransport): Future[Connection] {....raises: [],
    tags: [RootEffect].}
  Source   Edit
method dial(self: TcpTransport; hostname: string; address: MultiAddress;
            peerId: Opt[PeerId] = Opt.none(PeerId)): Future[Connection] {.
    ...raises: [], tags: [RootEffect].}
  Source   Edit
method handles(t: TcpTransport; address: MultiAddress): bool {....raises: [],
    tags: [].}
  Source   Edit
method start(self: TcpTransport; addrs: seq[MultiAddress]): Future[void] {.
    ...raises: [], tags: [RootEffect].}
  Source   Edit
method stop(self: TcpTransport): Future[void] {....raises: [], tags: [RootEffect].}
  Source   Edit

Exports

TransportInvalidAddrError, dial, upgrade, Transport, newTransportClosedError, stop, accept, TransportError, TransportClosedError, NetworkReachability, handles, dial, start, DNS_OR_IP, shortLog, random, UDP_DNS, $, getProtoHeader, MaError, ephemeral, MaPatternOp, ==, WS_DNS, initVBuffer, getProtoHeader, MaxSizeError, ProtoHeader, ProtoFlags, getLen, ECDHEScheme, shortLog, init, closed, [], macOpenArray, random, init, VBuffer, Secret, peekVarint, random, $, validate, bytes, maxInlineKeyLength, TranscoderDNS, QUIC, [], init, ephemeral, withValue, getRequiredField, getField, supported, WS_IP, write, public, MAKind, write, checkFieldNumber, valueOr, getRepeatedField, matchPartial, libp2p_pki_schemes, getBytes, len, readVarint, readLp, HTTP, initVBuffer, atEof, LPStreamTrackerName, write, toOpt, fullAddrs, payloadType, <=, LPStreamError, init, IP, protoAddress, newRng, DefaultConnectionTimeout, ==, checkValid, mac, getPublicKey, exceptionToAssert, len, CircuitRelay, extractPublicKey, mapAnd, new, verify, UDP_IP, new, newLPStreamEOFError, init, ==, DNSADDR, AddressMapper, init, write, PeerId, WSS, LPStream, TCP_IP, close, writePacked, init, init, closeImpl, readSeq, toBytes, TCP_DNS, shortLog, encode, len, capLen, init, protoName, toRawBytes, mapOr, $, initProtoBuffer, init, WSS_DNS, match, writeLPVarint, CryptoResult, parseFullAddress, ProtoResult, WebRTCDirect, init, init, UDP, TranscoderOnion, StreamTracker, write, init, LPStreamResetError, isEmpty, writeArray, decode, LPStreamIncompleteError, [], LPStreamEOFError, IP6, shortLog, initVBuffer, decode, PKScheme, toString, payload, init, stretchKeys, Connection, write, DNSANY, TCP, PrivateKey, getBytes, write, init, &=, PeerInfoError, hash, newLPStreamClosedError, random, write, compilesOr, TranscoderIP4, init, initProtoBuffer, toException, DNS, UTP, goffset, getRawBytes, >, KeyPair, init, init, high, cmp, init, SupportedWireTypes, formatItIMPL, formatItIMPL, formatItIMPL, Signature, contains, formatItIMPL, toBytes, DigestSheme, IPFS, getField, readOnce, isEmpty, ProtoScalar, shortLog, data, hex, protocols, HTTPS, WebSockets, LPError, getPtr, write, TLS_WS, sign, init, encode, update, MaResult, init, ProtoField, toBytes, writeSeq, init, &, DNS6, IpTransportProtocol, toOpenArray, init, IP4, TranscoderPort, isEnough, safeConvert, getField, init, >=, readVarint, payloadDomain, $, MaPattern, withValue, LPStreamLimitError, TranscoderOnion3, SignedPayload, toBytes, protoArgument, newLPStreamLimitError, write, keyOpenArray, match, parseFullAddress, $, isEmpty, writeLp, getRequiredRepeatedField, init, newLPStreamIncompleteError, initProtoBuffer, MAProtocol, newLPStreamResetError, getPackedRepeatedField, initStream, init, getField, shortLog, DNS4, getWrapped, readArray, selectBest, write, P2PPattern, Envelope, hasPublicKey, toException, isEnough, init, Reliable, addrs, hex, ProtoBuffer, closeImpl, getBytes, WS, init, init, encode, init, finish, getField, match, <, iv, readLine, Eof, CryptoError, getField, hash, append, vsizeof, init, WebSockets_DNS, WSS_IP, LPStreamConnDownError, peekArray, UNIX, PeerRecord, SupportedSchemes, getRepeatedField, getField, Unreliable, SupportedSchemesInt, random, checkFutures, shuffle, key, validate, $, protoCode, mapEq, getField, Onion3, write, TcpOnion3, concat, TranscoderP2P, PeerInfo, AddressInfo, ConnectionTrackerName, TranscoderIP6, finish, write, EnvelopeError, hash, encode, newLPStreamRemoteClosedError, TranscoderIP6Zone, MaPatResult, Direction, init, InvalidVarintError, decode, shortLog, items, ==, init, peekSeq, getBytes, write, init, init, init, PublicKey, WebSockets_IP, writeLp, writePBVarint, ProtoFieldKind, readExactly, protoArgument, getRepeatedField, ProtoError, newLPStreamConnDownError, initStream, getField, MultiAddress, ivOpenArray, closeWithEOF, TimeoutHandler, orError, getField, LPStreamRemoteClosedError, MaInvalidAddress, LPStreamClosedError, RsaDefaultKeySize, write, getOrder, TranscoderUnix, SignedPeerRecord, join, writeVarint, DNS_OR_IP, AlreadyExpectingConnectionError, shortLog, init, random, new, UDP_DNS, $, getProtoHeader, MaxConnectionsPerPeer, ephemeral, close, decode, MaPatternOp, ==, WS_DNS, initVBuffer, getProtoHeader, MaxSizeError, ProtoHeader, ProtoFlags, handler=, ==, getLen, handler, ECDHEScheme, shortLog, init, closed, addConnEventHandler, [], init, new, macOpenArray, random, init, new, Secret, peekVarint, random, handshake, MaxConnections, $, validate, mapOr, hash, MaError, init, UpgradeFailedError, IdentityInvalidMsgError, maxInlineKeyLength, addHandler, TranscoderDNS, QUIC, ProtoVersion, [], finish, withValue, getRequiredField, getField, supported, removeConnEventHandler, WS_IP, write, public, MAKind, write, write, init, getField, checkFieldNumber, valueOr, codec, getRepeatedField, matchPartial, addObservation, IdentityNoMatchError, push, getBytes, len, trackConnection, &, init, readLp, HTTP, initVBuffer, start, atEof, PeerEventKind, getOutgoingSlot, write, toOpt, fullAddrs, payloadType, <=, LPStreamError, init, decode, $, IP, protoAddress, newRng, IdentifyPushCodec, SecureConn, checkValid, getPublicKey, CircuitRelay, WebSockets, libp2p_failed_upgrades_incoming, exceptionToAssert, extractPublicKey, mapAnd, new, UDP_IP, new, newLPStreamEOFError, selectMuxer, connCount, write, DNSADDR, LPError, handler, AddressMapper, IdentifyPushHandler, write, ConnManager, WSS, getField, TCP_IP, selectMuxer, writePacked, handle, init, closeImpl, Identify, readSeq, toBytes, TCP_DNS, shortLog, encode, len, capLen, key, protoName, protoArgument, PeerEventHandler, LPProtoHandler, secure, toRawBytes, IdentifyPush, getStream, TranscoderIP6Zone, $, initProtoBuffer, init, maxIncomingStreams, WSS_DNS, list, match, <, CryptoResult, WebSockets_DNS, readMessage, ProtoResult, WebRTCDirect, init, upgrade, UDP, PeerInfo, TranscoderOnion, StreamTracker, IdentifyNoPubKeyError, write, getConnections, LPStreamResetError, isEmpty, writeArray, getRawBytes, new, toString, LPStreamIncompleteError, PeerId, LPStreamEOFError, readOnce, maxIncomingStreams=, IP6, shortLog, new, release, initVBuffer, PKScheme, init, new, payload, triggerConnEvent, triggerPeerEvents, init, Connection, write, TCP, PrivateKey, dropPeer, getBytes, start, write, init, close, &=, PeerInfoError, hash, newLPStreamClosedError, random, compilesOr, handle, trackMuxer, init, initProtoBuffer, toException, DNS, init, finish, Upgrade, goffset, HandlerHolder, >, SecureConnTrackerName, KeyPair, init, init, high, cmp, init, SupportedWireTypes, formatItIMPL, formatItIMPL, initStream, formatItIMPL, Signature, formatItIMPL, getStream, IPFS, getField, shortLog, readOnce, init, secure, isEmpty, ConnEventKind, MultiAddress, ProtoScalar, shortLog, contains, hex, expandItIMPL, protocols, codec=, bytes, DefaultMaxIncomingStreams, HTTPS, UNIX, encode, TooManyConnectionsError, ConnectionSlot, getPtr, getBytes, TLS_WS, TranscoderIP6, readVarint, addHandler, storeMuxer, TranscoderIP4, formatItIMPL, PeerEvent, data, ObservedAddrManager, MaResult, ProtoField, IdentifyCodec, getStream, writeSeq, DigestSheme, ConnEvent, ==, $, DNS6, [], IpTransportProtocol, toOpenArray, init, IP4, TranscoderPort, isEnough, safeConvert, addPeerEventHandler, init, >=, expectConnection, ephemeral, payloadDomain, update, $, withValue, init, init, LPStreamLimitError, removePeerEventHandler, TranscoderOnion3, SignedPayload, closeImpl, toBytes, Secure, newLPStreamLimitError, MaPattern, keyOpenArray, match, parseFullAddress, $, closeImpl, isEmpty, writeLp, connectedPeers, mac, new, getRequiredRepeatedField, init, newLPStreamIncompleteError, initProtoBuffer, MAProtocol, newLPStreamResetError, decode, getPackedRepeatedField, initStream, contains, init, getField, shortLog, DNS4, getWrapped, readArray, selectBest, peekSeq, P2PPattern, getWrapped, Envelope, hasPublicKey, toException, contains, init, isEnough, init, Reliable, init, addrs, hex, slotsAvailable, write, WS, AgentVersion, init, DNSANY, MultistreamSelect, encode, LPProtocol, init, TimeoutHandler, stretchKeys, init, getField, match, getField, writeLPVarint, iv, DefaultConnectionTimeout, new, readLine, Eof, CryptoError, append, init, parseFullAddress, WSS_IP, LPStreamConnDownError, PeerRecord, init, SupportedSchemes, getRepeatedField, getField, select, Unreliable, SupportedSchemesInt, random, checkFutures, handler=, libp2p_failed_upgrades_outgoing, shuffle, validate, Matcher, mapEq, init, libp2p_pki_schemes, Onion3, write, LPStreamTrackerName, identify, select, concat, TranscoderP2P, AddressInfo, ConnectionTrackerName, sign, init, write, EnvelopeError, verify, IdentifyInfo, IdentifyError, addHandler, encode, len, newLPStreamRemoteClosedError, MaPatResult, Direction, ProtoBuffer, InvalidVarintError, shortLog, ==, write, getBytes, write, UTP, toBytes, peekArray, init, getMostObservedProtosAndPorts, init, PublicKey, ConnEventHandler, WebSockets_IP, decodeMsg, VBuffer, writeLp, writePBVarint, ProtoFieldKind, readExactly, protoArgument, getRepeatedField, ProtoError, newLPStreamConnDownError, init, initStream, getField, readVarint, ivOpenArray, closeWithEOF, TcpOnion3, orError, vsizeof, getField, LPStreamRemoteClosedError, guessDialableAddr, MultiStreamError, protoCode, stop, MaInvalidAddress, select, LPStream, LPStreamClosedError, RsaDefaultKeySize, writeVarint, getIncomingSlot, items, write, toBytes, getOrder, hash, TranscoderUnix, SignedPeerRecord, init, stop, join