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