Skip to content

Instantly share code, notes, and snippets.

@funrep
Created April 23, 2013 16:12
Show Gist options
  • Save funrep/5444994 to your computer and use it in GitHub Desktop.
Save funrep/5444994 to your computer and use it in GitHub Desktop.
module Main where
import System.Environment
import System.IO
import Control.Monad (unless)
import Server
import Client
test :: HandlerFunc
test h msg = unless (show msg == "not") $ hPutStrLn h msg
temp :: [String] -> IO ()
temp ["client", hostname, port] = runClient hostname (fromIntegral $ read port) "hello"
temp ["server", port] = runServer (fromIntegral $ read port) test
temp _ = getProgName >>= putStr . (++) "Usage: " >> putStrLn " [OPTIONS]"
main = getArgs >>= temp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment