main = do
  [host, port, n] <- getArgs
  sok <- initSocket host port -- intialise the server socket
  putStrLn $ "staring server on " ++ host ++ ":" ++ port
  kill <- newEmptyMVar
  li <- newMVar (read n :: Int)
  rms <- newTVarIO []
  let inf = ("IP:10.62.0.104\nPort:"++port++"\nStudentID:13319506\n")
      ser = Server {info=inf, sock=sok, roomsList=rms, stop=kill, limit=li}
  --_ <- forkIO $ runServer sock  (read n :: Int) ("IP:10.62.0.104\nPort:"++port++"\nStudentID:13319506\n") kill
  _ <- forkIO $ runServer ser
  takeMVar kill
  putStrLn "Terminating Server"