diff options
author | Sam T <pxqr.sta@gmail.com> | 2013-05-12 04:47:45 +0400 |
---|---|---|
committer | Sam T <pxqr.sta@gmail.com> | 2013-05-12 04:47:45 +0400 |
commit | e188c26f9e6b548b5170fb86f1bd4beee1f84708 (patch) | |
tree | 530b33a499d94ab35371311031fda921350345f0 /src/Remote/KRPC/Protocol.hs | |
parent | fd62eb70fe87b471d29cb994a60ad88f58b33ca9 (diff) |
+ Multi param procedures.
Diffstat (limited to 'src/Remote/KRPC/Protocol.hs')
-rw-r--r-- | src/Remote/KRPC/Protocol.hs | 6 |
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 |
79 | data KError | 79 | data 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 | |||
213 | withRemote :: (MonadBaseControl IO m, MonadIO m) => (KRemote -> m a) -> m a | 213 | withRemote :: (MonadBaseControl IO m, MonadIO m) => (KRemote -> m a) -> m a |
214 | withRemote = bracket (liftIO (socket AF_INET Datagram defaultProtocol)) | 214 | withRemote = bracket (liftIO (socket AF_INET Datagram defaultProtocol)) |
215 | (liftIO . sClose) | 215 | (liftIO . sClose) |
216 | {-# SPECIALIZE withRemote :: (KRemote -> IO a) -> IO a #-} | ||
217 | |||
216 | 218 | ||
217 | maxMsgSize :: Int | 219 | maxMsgSize :: Int |
218 | maxMsgSize = 16 * 1024 | 220 | maxMsgSize = 16 * 1024 |
221 | {-# INLINE maxMsgSize #-} | ||
222 | |||
219 | 223 | ||
220 | -- TODO eliminate toStrict | 224 | -- TODO eliminate toStrict |
221 | sendMessage :: BEncodable msg => msg -> KRemoteAddr -> KRemote -> IO () | 225 | sendMessage :: BEncodable msg => msg -> KRemoteAddr -> KRemote -> IO () |