Skip to content

Instantly share code, notes, and snippets.

@arkeet
arkeet / Network.hs
Last active December 23, 2015 02:39
module Game.TcgMud.Network
( runServer
) where
import Control.Concurrent (forkIO, threadDelay)
import Control.Concurrent.STM (atomically, TVar, newTVarIO, readTVar, modifyTVar')
import Control.Monad (forever)
import Network (HostName, withSocketsDo, listenOn, PortNumber, PortID(PortNumber), accept)
import System.IO (Handle, hGetLine, hPrint, hClose)
import Control.Exception (finally)