http2
Safe HaskellNone
LanguageHaskell2010

Network.HTTP2.Server.Internal

Contents

Synopsis

Documentation

newtype Request #

Constructors

Request InpObj 

Instances

Instances details
Show Request # 
Instance details

Defined in Network.HTTP.Semantics.Server.Internal

Methods

showsPrec :: Int -> Request -> ShowS

show :: Request -> String

showList :: [Request] -> ShowS

newtype Response #

Constructors

Response OutObj 

Instances

Instances details
Show Response # 
Instance details

Defined in Network.HTTP.Semantics.Server.Internal

Methods

showsPrec :: Int -> Response -> ShowS

show :: Response -> String

showList :: [Response] -> ShowS

data Config Source #

HTTP/2 configuration.

Constructors

Config 

Fields

  • confWriteBuffer :: Buffer

    This is used only by frameSender. This MUST be freed after frameSender is terminated.

  • confBufferSize :: BufferSize

    The size of the write buffer. We assume that the read buffer is the same size. So, this value is announced via SETTINGS_MAX_FRAME_SIZE to the peer.

  • confSendAll :: ByteString -> IO ()

    Not used when confSendAllWith is Just. When replacing it in a config which has one, e.g. from allocSimpleConfig, set confSendAllWith to Nothing or to a send of the same kind.

  • confSendAllWith :: Maybe (STM () -> ByteString -> IO (Either () ()))

    confSendAll which the library can give up on: Left when the STM action fires first. With it, a write which the peer does not read is ended by the timeout rather than by killing a thread. Part of the data may have gone, so the connection is closed after.

    Since: 5.4.13

  • confReadN :: Int -> IO ByteString

    When confReadNWith is Just, frames are read with it and only the connection preface with this. When replacing it in a config which has one, e.g. from allocSimpleConfig, set confReadNWith to Nothing or to a read of the same kind sharing its buffer.

  • confReadNWith :: Maybe (STM () -> Int -> IO ByteString)

    confReadN which the library can give up on: it answers with an empty string, as at end of input, when the STM action fires first. With it, the reader is stopped without being interrupted. It must share its buffer with confReadN.

    Since: 5.4.13

  • confPositionReadMaker :: PositionReadMaker
     
  • confTimeoutManager :: Manager
     
  • confMySockAddr :: SockAddr

    This is copied into Aux, if exist, on server.

  • confPeerSockAddr :: SockAddr

    This is copied into Aux, if exist, on server.

  • confReadNTimeout :: Bool
     
  • confOnInformational :: StreamId -> TokenHeaderTable -> IO ()

    Client only: called when a 1xx informational response (e.g. 103 Early Hints) is received on the given stream, ahead of the final response. No-op by default.

    Since: 5.4.2

data ServerConfig Source #

Server configuration

Constructors

ServerConfig 

Fields

Instances

Instances details
Eq ServerConfig Source # 
Instance details

Defined in Network.HTTP2.Server.Run

Methods

(==) :: ServerConfig -> ServerConfig -> Bool

(/=) :: ServerConfig -> ServerConfig -> Bool

Show ServerConfig Source # 
Instance details

Defined in Network.HTTP2.Server.Run

Methods

showsPrec :: Int -> ServerConfig -> ShowS

show :: ServerConfig -> String

showList :: [ServerConfig] -> ShowS

data Aux #

Constructors

Aux 

Fields

Low level

data Stream Source #

Instances

Instances details
Show Stream Source # 
Instance details

Defined in Network.HTTP2.H2.Types

Methods

showsPrec :: Int -> Stream -> ShowS

show :: Stream -> String

showList :: [Stream] -> ShowS

data ServerIO a Source #

Constructors

ServerIO 

Fields

runIO :: ServerConfig -> Config -> (ServerIO Stream -> IO (IO ())) -> IO () Source #

Launching a receiver and a sender without workers. Any frames can be sent with sioWriteBytes.

runIOWith :: STM () -> ServerConfig -> Config -> (ServerIO Stream -> IO (IO ())) -> IO () Source #

Like runIO, but the connection goes away once the STM action fires, as with runWith.

Since: 5.4.13