libp2p/transports/tcptransport

Search:
Group by:
Source   Edit  

TCP transport implementation

Types

TcpTransport = ref object of Transport
  servers*: seq[StreamServer]
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]; localAddr: Opt[MultiAddress];
                 dir: Direction): Connection {....raises: [],
    tags: [TimeEffect, RootEffect], forbids: [].}
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): InternalRaisesFuture[Connection,
    (TransportError, CancelledError)] {....stackTrace: false, raises: [], gcsafe,
                                        raises: [], tags: [RootEffect],
                                        forbids: [].}

accept a new TCP connection, returning nil on non-fatal errors

Raises an exception when the transport is broken and cannot be used for accepting further connections

Source   Edit  
method dial(self: TcpTransport; hostname: string; address: MultiAddress;
            peerId: Opt[PeerId] = Opt.none(PeerId)): InternalRaisesFuture[
    Connection, (TransportError, CancelledError)] {....stackTrace: false,
    raises: [], gcsafe, raises: [], tags: [RootEffect], forbids: [].}
dial a peer Source   Edit  
method handles(t: TcpTransport; address: MultiAddress): bool {....raises: [],
    raises: [], tags: [], forbids: [].}
Source   Edit  
method start(self: TcpTransport; addrs: seq[MultiAddress]): InternalRaisesFuture[
    void, (LPError, TransportError, CancelledError)] {....stackTrace: false,
    raises: [], gcsafe, raises: [], tags: [RootEffect], forbids: [].}
Start transport listening to the given addresses - for dial-only transports, start with an empty list Source   Edit  
method stop(self: TcpTransport): InternalRaisesFuture[void, void] {.
    ...stackTrace: false, raises: [], gcsafe, raises: [], tags: [RootEffect],
    forbids: [].}
Source   Edit  

Exports

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