Created
April 23, 2013 16:12
-
-
Save funrep/5444994 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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