| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
LibP2P.Transport
Description
Transport abstraction for libp2p.
Defines the record-of-functions pattern for transport-agnostic connection management. Stream transports produce a byte stream for the standard security/muxer upgrade; native multiplexed transports such as QUIC provide an already authenticated stream multiplexer.
Synopsis
- data ConnectionEndpoint
- data NativeMuxer = NativeMuxer {
- nativePeerId :: !PeerId
- nativeSecurity :: !ProtocolId
- nativeMuxerProtocol :: !ProtocolId
- nativeOpenStream :: !(IO StreamIO)
- nativeAcceptStream :: !(IO StreamIO)
- nativeClose :: !(IO ())
- data RawConnection = RawConnection {
- rcEndpoint :: !ConnectionEndpoint
- rcLocalAddr :: !Multiaddr
- rcRemoteAddr :: !Multiaddr
- rcClose :: !(IO ())
- data Listener = Listener {
- listenerAccept :: !(IO RawConnection)
- listenerClose :: !(IO ())
- listenerAddr :: !Multiaddr
- data Transport = Transport {
- transportDial :: !(Multiaddr -> IO RawConnection)
- transportDialFrom :: !(Maybe Multiaddr -> Multiaddr -> IO RawConnection)
- transportListen :: !(Multiaddr -> IO Listener)
- transportCanDial :: !(Multiaddr -> Bool)
Documentation
data ConnectionEndpoint Source #
The I/O endpoint established by a transport.
Constructors
| ByteStreamEndpoint !StreamIO | |
| NativeMuxerEndpoint !NativeMuxer |
data NativeMuxer Source #
A transport-native authenticated stream multiplexer.
Constructors
| NativeMuxer | |
Fields
| |
data RawConnection Source #
A connection established by a transport.
TCP and relayed connections carry an unencrypted byte stream. QUIC carries a TLS-authenticated native multiplexer and therefore bypasses Noise/Yamux.
Constructors
| RawConnection | |
Fields
| |
A listener that accepts inbound connections.
Constructors
| Listener | |
Fields
| |
Transport provides dial/listen capabilities for a specific protocol.
Constructors
| Transport | |
Fields
| |