summaryrefslogtreecommitdiff
path: root/src/Remote/KRPC/Protocol.hs
diff options
context:
space:
mode:
authorSam T <pxqr.sta@gmail.com>2013-05-12 04:47:45 +0400
committerSam T <pxqr.sta@gmail.com>2013-05-12 04:47:45 +0400
commite188c26f9e6b548b5170fb86f1bd4beee1f84708 (patch)
tree530b33a499d94ab35371311031fda921350345f0 /src/Remote/KRPC/Protocol.hs
parentfd62eb70fe87b471d29cb994a60ad88f58b33ca9 (diff)
+ Multi param procedures.
Diffstat (limited to 'src/Remote/KRPC/Protocol.hs')
-rw-r--r--src/Remote/KRPC/Protocol.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Remote/KRPC/Protocol.hs b/src/Remote/KRPC/Protocol.hs
index 625aba25..98674c51 100644
--- a/src/Remote/KRPC/Protocol.hs
+++ b/src/Remote/KRPC/Protocol.hs
@@ -74,7 +74,7 @@ class KMessage message scheme | message -> scheme where
74 validate = (==) . scheme 74 validate = (==) . scheme
75 {-# INLINE validate #-} 75 {-# INLINE validate #-}
76 76
77 77-- TODO Text -> ByteString
78-- TODO document that it is and how transferred 78-- TODO document that it is and how transferred
79data KError 79data KError
80 -- | Some error doesn't fit in any other category. 80 -- | Some error doesn't fit in any other category.
@@ -213,9 +213,13 @@ type KRemote = Socket
213withRemote :: (MonadBaseControl IO m, MonadIO m) => (KRemote -> m a) -> m a 213withRemote :: (MonadBaseControl IO m, MonadIO m) => (KRemote -> m a) -> m a
214withRemote = bracket (liftIO (socket AF_INET Datagram defaultProtocol)) 214withRemote = bracket (liftIO (socket AF_INET Datagram defaultProtocol))
215 (liftIO . sClose) 215 (liftIO . sClose)
216{-# SPECIALIZE withRemote :: (KRemote -> IO a) -> IO a #-}
217
216 218
217maxMsgSize :: Int 219maxMsgSize :: Int
218maxMsgSize = 16 * 1024 220maxMsgSize = 16 * 1024
221{-# INLINE maxMsgSize #-}
222
219 223
220-- TODO eliminate toStrict 224-- TODO eliminate toStrict
221sendMessage :: BEncodable msg => msg -> KRemoteAddr -> KRemote -> IO () 225sendMessage :: BEncodable msg => msg -> KRemoteAddr -> KRemote -> IO ()