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