equal
deleted
inserted
replaced
8 import Control.Monad.State.Strict |
8 import Control.Monad.State.Strict |
9 import Data.Set as Set |
9 import Data.Set as Set |
10 import qualified Data.ByteString.Char8 as B |
10 import qualified Data.ByteString.Char8 as B |
11 import Control.DeepSeq |
11 import Control.DeepSeq |
12 import Data.Unique |
12 import Data.Unique |
|
13 import Data.Maybe |
13 -------------------------------------- |
14 -------------------------------------- |
14 import CoreTypes |
15 import CoreTypes |
15 import NetRoutines |
16 import NetRoutines |
16 import HWProtoCore |
17 import HWProtoCore |
17 import Actions |
18 import Actions |
63 TimerAction tick -> |
64 TimerAction tick -> |
64 mapM_ processAction $ |
65 mapM_ processAction $ |
65 PingAll : [StatsAction | even tick] |
66 PingAll : [StatsAction | even tick] |
66 |
67 |
67 |
68 |
68 startServer :: ServerInfo -> Socket -> IO () |
69 startServer :: ServerInfo -> IO () |
69 startServer si serverSocket = do |
70 startServer si = do |
70 putStrLn $ "Listening on port " ++ show (listenPort si) |
71 noticeM "Core" $ "Listening on port " ++ show (listenPort si) |
71 |
72 |
72 _ <- forkIO $ |
73 _ <- forkIO $ |
73 acceptLoop |
74 acceptLoop |
74 serverSocket |
75 (fromJust $ serverSocket si) |
75 (coreChan si) |
76 (coreChan si) |
76 |
77 |
77 return () |
78 return () |
78 |
79 |
79 _ <- forkIO $ timerLoop 0 $ coreChan si |
80 _ <- forkIO $ timerLoop 0 $ coreChan si |