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, $, <=, MaError, ephemeral, MaPatternOp, ==, WS_DNS, initVBuffer, getProtoHeader, MaxSizeError, ProtoHeader, ProtoFlags, getLen, ECDHEScheme, shortLog, init, init, closed, [], decode, macOpenArray, random, init, VBuffer, Secret, peekVarint, random, $, validate, init, bytes, maxInlineKeyLength, TranscoderDNS, QUIC, [], ephemeral, withValue, getRequiredField, getField, init, supported, WS_IP, safeConvert, public, MAKind, write, peekSeq, init, checkFieldNumber, valueOr, init, getRepeatedField, matchPartial, libp2p_pki_schemes, getBytes, len, readLp, HTTP, initVBuffer, atEof, LPStreamTrackerName, write, toOpt, fullAddrs, payloadType, getProtoHeader, LPStreamError, init, decode, IP, protoAddress, newRng, DefaultConnectionTimeout, ==, withValue, checkValid, mac, getPublicKey, exceptionToAssert, WebSockets, CircuitRelay, extractPublicKey, mapAnd, new, verify, UDP_IP, new, newLPStreamEOFError, ==, 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, UDP, TranscoderOnion, StreamTracker, write, init, LPStreamResetError, isEmpty, writeArray, decode, LPStreamIncompleteError, [], LPStreamEOFError, IP6, shortLog, initVBuffer, PKScheme, finish, toString, payload, init, stretchKeys, Connection, write, DNSANY, TCP, PrivateKey, getBytes, write, init, &=, PeerInfoError, hash, newLPStreamClosedError, random, write, compilesOr, TranscoderIP4, initProtoBuffer, toException, DNS, UTP, goffset, getRawBytes, >, KeyPair, init, high, init, cmp, init, SupportedWireTypes, formatItIMPL, formatItIMPL, formatItIMPL, Signature, contains, formatItIMPL, toBytes, DigestSheme, IPFS, getField, readOnce, isEmpty, ProtoScalar, shortLog, data, hex, protocols, HTTPS, len, LPError, getPtr, write, TLS_WS, sign, init, encode, update, MaResult, key, ProtoField, init, toBytes, writeSeq, init, &, DNS6, IpTransportProtocol, toOpenArray, init, IP4, TranscoderPort, isEnough, getBytes, getField, init, >=, readVarint, payloadDomain, $, MaPattern, withValue, init, LPStreamLimitError, TranscoderOnion3, SignedPayload, toBytes, protoArgument, newLPStreamLimitError, 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, init, isEnough, init, readVarint, Reliable, addrs, hex, ProtoBuffer, closeImpl, write, WS, encode, init, getField, match, <, iv, readLine, Eof, CryptoError, getField, hash, append, 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, hash, encode, newLPStreamRemoteClosedError, TranscoderIP6Zone, MaPatResult, Direction, InvalidVarintError, shortLog, items, ==, write, getBytes, write, init, 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, hash, MaError, init, UpgradeFailedError, IdentityInvalidMsgError, maxInlineKeyLength, addHandler, TranscoderDNS, QUIC, ProtoVersion, [], init, withValue, getRequiredField, getField, supported, removeConnEventHandler, WS_IP, write, public, MAKind, decode, write, data, getField, checkFieldNumber, valueOr, codec, getRepeatedField, matchPartial, addObservation, IdentityNoMatchError, push, getBytes, len, trackConnection, &, init, readLp, HTTP, initVBuffer, start, atEof, ephemeral, PeerEventKind, getOutgoingSlot, peekSeq, toOpt, fullAddrs, payloadType, getProtoHeader, LPStreamError, $, IP, protoAddress, 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, key, 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, hash, newLPStreamClosedError, random, compilesOr, handle, trackMuxer, init, initProtoBuffer, toException, DNS, init, finish, Upgrade, goffset, HandlerHolder, getRawBytes, >, 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, sign, readVarint, addHandler, storeMuxer, TranscoderIP4, formatItIMPL, PeerEvent, ObservedAddrManager, MaResult, init, ProtoField, init, IdentifyCodec, getStream, writeSeq, DigestSheme, ConnEvent, init, ==, $, DNS6, [], IpTransportProtocol, toOpenArray, init, IP4, TranscoderPort, isEnough, safeConvert, addPeerEventHandler, init, >=, expectConnection, init, finish, 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, init, Reliable, init, addrs, hex, slotsAvailable, write, decode, WS, AgentVersion, init, DNSANY, 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, Unreliable, SupportedSchemesInt, random, checkFutures, handler=, libp2p_failed_upgrades_outgoing, shuffle, validate, Matcher, mapEq, init, removePeerEventHandler, Onion3, write, LPStreamTrackerName, identify, select, concat, TranscoderP2P, AddressInfo, ConnectionTrackerName, TranscoderIP6, write, EnvelopeError, verify, IdentifyInfo, IdentifyError, addHandler, encode, WebSockets, newLPStreamRemoteClosedError, MaPatResult, Direction, ProtoBuffer, init, InvalidVarintError, shortLog, ==, write, getBytes, write, UTP, readVarint, toBytes, peekArray, getMostObservedProtosAndPorts, init, PublicKey, ConnEventHandler, WebSockets_IP, decodeMsg, VBuffer, writeLp, writePBVarint, ProtoFieldKind, readExactly, protoArgument, getRepeatedField, ProtoError, newLPStreamConnDownError, init, initStream, getField, 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