Safe Haskell | None |
---|---|
Language | Haskell98 |
Manages a pool of available ports and allocates them.
Synopsis
- data PortPool
- getPort :: (LogMessage -> IO ()) -> PortPool -> IO (Either SomeException Port)
- releasePort :: PortPool -> Port -> IO ()
- start :: PortSettings -> IO PortPool
Types
Actions
getPort :: (LogMessage -> IO ()) -> PortPool -> IO (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.