
Yitzchak Gale
Although the function Network.accept does an implied reverse DNS lookup, it does so lazily. So the actual lookup should not happen unless the library client actually tries to use the host name.
I've looked at the source code but I don't recognize how the lazyness is achieved w.r.t. to the RDNS lookup, here's the relevant source fragment from [1]: accept sock@(MkSocket _ AF_INET _ _ _) = do ~(sock', (SockAddrInet port haddr)) <- Socket.accept sock peer <- catchIO (do (HostEntry peer _ _ _) <- getHostByAddr AF_INET haddr return peer ) (\_e -> inet_ntoa haddr) handle <- socketToHandle sock' ReadWriteMode return (handle, peer, port) the blocking operation would be 'getHostByAddr' but I don't see any measure to turn that into a lazy I/O operation. What am I overlooking? [1]: http://hackage.haskell.org/packages/archive/network/2.4.1.2/doc/html/src/Net...