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