| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Network.Transport.QUIC.Internal
Synopsis
- createTransport :: QUICTransportConfig -> IO Transport
- data QUICTransportConfig = QUICTransportConfig {}
- defaultQUICTransportConfig :: HostName -> NonEmpty Credential -> QUICTransportConfig
- data QUICAddr = QUICAddr {
- quicBindHost :: !HostName
- quicBindPort :: !ServiceName
- quicEndpointId :: !EndPointId
- encodeQUICAddr :: QUICAddr -> EndPointAddress
- decodeQUICAddr :: EndPointAddress -> Either String QUICAddr
- type Credential = (CertificateChain, PrivKey)
- credentialLoadX509 :: FilePath -> FilePath -> IO (Either String Credential)
- decodeMessage :: (Int -> IO ByteString) -> IO (Either String MessageReceived)
- data MessageReceived
- = Message !ClientConnId ![ByteString]
- | CloseConnection !ClientConnId
- | CloseEndPoint
- | StreamClosed
- encodeMessage :: ClientConnId -> [ByteString] -> [ByteString]
Documentation
createTransport :: QUICTransportConfig -> IO Transport Source #
Create a new Transport based on the QUIC protocol.
Only a single transport should be created per Haskell process (threads can, and should, create their own endpoints though).
data QUICTransportConfig Source #
Represents the configuration used by the entire transport.
Constructors
| QUICTransportConfig | |
Fields
| |
Instances
| Show QUICTransportConfig Source # | |
Defined in Network.Transport.QUIC.Internal.QUICTransport Methods showsPrec :: Int -> QUICTransportConfig -> ShowS # show :: QUICTransportConfig -> String # showList :: [QUICTransportConfig] -> ShowS # | |
| Eq QUICTransportConfig Source # | |
Defined in Network.Transport.QUIC.Internal.QUICTransport Methods (==) :: QUICTransportConfig -> QUICTransportConfig -> Bool # (/=) :: QUICTransportConfig -> QUICTransportConfig -> Bool # | |
Constructors
| QUICAddr | |
Fields
| |
encodeQUICAddr :: QUICAddr -> EndPointAddress Source #
Encode a QUICAddr to EndPointAddress
decodeQUICAddr :: EndPointAddress -> Either String QUICAddr Source #
Decode end point address
Re-export to generate credentials
type Credential = (CertificateChain, PrivKey) #
Arguments
| :: FilePath | public certificate (X.509 format) |
| -> FilePath | private key associated |
| -> IO (Either String Credential) |
try to create a new credential object from a public certificate and the associated private key that are stored on the filesystem in PEM format.
Message encoding and decoding
decodeMessage :: (Int -> IO ByteString) -> IO (Either String MessageReceived) Source #
data MessageReceived Source #
Constructors
| Message !ClientConnId ![ByteString] | |
| CloseConnection !ClientConnId | |
| CloseEndPoint | |
| StreamClosed |
Instances
| Show MessageReceived Source # | |
Defined in Network.Transport.QUIC.Internal.Messaging Methods showsPrec :: Int -> MessageReceived -> ShowS # show :: MessageReceived -> String # showList :: [MessageReceived] -> ShowS # | |
| Eq MessageReceived Source # | |
Defined in Network.Transport.QUIC.Internal.Messaging Methods (==) :: MessageReceived -> MessageReceived -> Bool # (/=) :: MessageReceived -> MessageReceived -> Bool # | |
encodeMessage :: ClientConnId -> [ByteString] -> [ByteString] Source #
Encode a message.
The encoding is composed of a header, and the payloads. The message header is composed of: 1. A control byte, to determine how the message should be parsed. 2. A 32-bit word that encodes the endpoint ID of the destination endpoint; 3. A 32-bit word that encodes the number of frames in the message
The payload frames are each prepended with the length of the frame.