From d0038e9bde22751c9c926796a6c46be62a3cb81b Mon Sep 17 00:00:00 2001 From: Sam T Date: Tue, 14 May 2013 10:27:36 +0400 Subject: ~ Minor changes. --- examples/Client.hs | 4 ++++ examples/Server.hs | 1 + examples/Shared.hs | 6 +++++- 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/Client.hs b/examples/Client.hs index cd340a03..ec86639e 100644 --- a/examples/Client.hs +++ b/examples/Client.hs @@ -1,6 +1,7 @@ {-# LANGUAGE OverloadedStrings #-} module Main (main) where +import qualified Data.ByteString as B import System.Environment import Remote.KRPC import Shared @@ -16,6 +17,9 @@ main = do call addr reverseM [1..1000] print =<< call addr swapM (0, 1) print =<< call addr shiftR ((), 1, [2..10]) + let bs = B.replicate (32 * 1024) 0 + bs' <- call addr echoBytes bs + print (bs == bs') {- forM_ [1..] $ const $ do diff --git a/examples/Server.hs b/examples/Server.hs index 0407c304..f636b0be 100644 --- a/examples/Server.hs +++ b/examples/Server.hs @@ -9,6 +9,7 @@ main :: IO () main = server 6000 [ unitM ==> return , echoM ==> return + , echoBytes ==> return , swapM ==> \(a, b) -> return (b, a) , reverseM ==> return . reverse , shiftR ==> \(a, b, c) -> return (c, a, b) diff --git a/examples/Shared.hs b/examples/Shared.hs index 2d5b9cbb..e0e5268c 100644 --- a/examples/Shared.hs +++ b/examples/Shared.hs @@ -1,8 +1,9 @@ {-# LANGUAGE OverloadedStrings #-} module Shared - (echoM, unitM, swapM, reverseM, shiftR + (echoM, echoBytes, unitM, swapM, reverseM, shiftR ) where +import Data.ByteString (ByteString) import Remote.KRPC unitM :: Method () () @@ -11,6 +12,9 @@ unitM = method "unit" [] [] echoM :: Method Int Int echoM = method "echo" ["x"] ["x"] +echoBytes :: Method ByteString ByteString +echoBytes = method "echoBytes" ["x"] ["x"] + reverseM :: Method [Int] [Int] reverseM = method "reverse" ["xs"] ["ys"] -- cgit v1.2.3