Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
Manages a pool of available ports and allocates them.
Synopsis
- data PortPool
- getPort :: PortPool -> KeterM cfg (Either SomeException Port)
- releasePort :: PortPool -> Port -> IO ()
- start :: PortSettings -> IO PortPool
Types
Actions
getPort :: PortPool -> KeterM cfg (Either SomeException Port) Source #
Gets an unassigned port number.
releasePort :: PortPool -> Port -> IO () Source #
Return a port to the recycled collection of the pool. Note that recycling puts the new ports at the end of the queue (FIFO), so that if an application holds onto the port longer than expected, there should be no issues.