Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- openFreePort :: IO (Int, Socket)
- getFreePort :: IO Int
Documentation
openFreePort :: IO (Int, Socket) Source #
Open a TCP socket on a random free port. This is like warp'
s
openFreePort.
Since 0.0.0.1
getFreePort :: IO Int Source #
Open a TCP socket, get its port and close the socket. Useful when you have an external service that needs a fresh port.
There is a small race condition present: It's possible to get a free port only for it to be bound by some other process or thread before used
Since 0.2.1