http2-5.3.10: HTTP/2 library

Safe Haskell | None
Language | Haskell2010

Network.HTTP2.Server.Internal

Contents

- Low level

Synopsis

- newtype Request = Request InpObj
- newtype Response = Response OutObj
- data Aux = Aux {
  - auxTimeHandle :: Handle
  - auxMySockAddr :: SockAddr
  - auxPeerSockAddr :: SockAddr
  }
- data Stream
- data ServerIO a = ServerIO {
  - sioMySockAddr :: SockAddr
  - sioPeerSockAddr :: SockAddr
  - sioReadRequest :: IO (a, Request)
  - sioWriteResponse :: a -> Response -> IO ()
  }
- runIO :: ServerConfig -> Config -> (ServerIO Stream -> IO (IO ())) -> IO ()

# Documentation

newtype Request Source #

Request from client.

Constructors

Request InpObj |

#### Instances

Instances details

Show Request |
Instance details Defined in Network.HTTP.Semantics.Server.Internal Methods showsPrec :: Int -> Request -> ShowS Source # show :: Request -> String Source # showList :: [Request] -> ShowS Source #

newtype Response Source #

Response from server.

Constructors

Response OutObj |

#### Instances

Instances details

Show Response |
Instance details Defined in Network.HTTP.Semantics.Server.Internal Methods showsPrec :: Int -> Response -> ShowS Source # show :: Response -> String Source # showList :: [Response] -> ShowS Source #

data Aux Source #

Additional information.

Constructors

Aux |

Fields

- auxTimeHandle :: Handle

  Time handle for the worker processing this request and response.

- auxMySockAddr :: SockAddr

  Local socket address copied from `Config`.

- auxPeerSockAddr :: SockAddr

  Remove socket address copied from `Config`.

# Low level

data Stream Source #

#### Instances

Instances details

Show Stream Source # |
Instance details Defined in Network.HTTP2.H2.Types Methods showsPrec :: Int -> Stream -> ShowS Source # show :: Stream -> String Source # showList :: [Stream] -> ShowS Source #

data ServerIO a Source #

Constructors

ServerIO |

Fields

- sioMySockAddr :: SockAddr
- sioPeerSockAddr :: SockAddr
- sioReadRequest :: IO (a, Request)
- sioWriteResponse :: a -> Response -> IO ()

  `Response` MUST be created with `responseBuilder`. Others are not supported.

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

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