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