module Main where import Control.Concurrent import Control.Concurrent.STM import qualified Data.ByteString as BS import Network.RPCA.Channel import Network.RPCA.Structs import Network.RPCA.Util import System.Time import qualified TestRPC import Text.Printf (printf) cb :: Either ErrorCode TestRPC.Addnumbersreply -> IO () cb reply = case reply of (Left errorcode) -> print errorcode (Right (TestRPC.Addnumbersreply { TestRPC.addnumbersreply_c = c })) -> return () main = do chan <- networkChannel "test" "127.0.0.1" 4545 getClockTime >>= print sequence $ replicate 10000 ((rpc chan "add" (TestRPC.Addnumbersrequest 400 300) 1) :: IO (Either ErrorCode TestRPC.Addnumbersreply)) getClockTime >>= print