1module Util.Net (listenOnLocalhost) where
4import Network.Socket hiding (sClose, PortNumber)
5import Network.BSD (getProtocolNumber)
6import Control.Exception (bracketOnError)
8-- Copied from upstream impl of listenOn
9-- bound to localhost interface instead of iNADDR_ANY
10listenOnLocalhost (PortNumber port) = do
11 proto <- getProtocolNumber "tcp"
12 localhost <- inet_addr "127.0.0.1"
14 (socket AF_INET Stream proto)
17 setSocketOption sock ReuseAddr 1
18 bindSocket sock (SockAddrInet port localhost)
19 listen sock maxListenQueue
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list