summaryrefslogtreecommitdiff
path: root/src/Network/KRPC/Protocol.hs
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2013-10-03 15:56:31 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2013-10-03 15:56:31 +0400
commitd8bec96d7ff43453f5ddda470ac80346a6c7e3c1 (patch)
tree5728617851fb247e39d252cc814d1b73f45bf2fb /src/Network/KRPC/Protocol.hs
parent908a20ca2880a9047f7fbf07e33f18caf53f5109 (diff)
Eliminate bytestring copying in sendMessage function
Diffstat (limited to 'src/Network/KRPC/Protocol.hs')
-rw-r--r--src/Network/KRPC/Protocol.hs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/Network/KRPC/Protocol.hs b/src/Network/KRPC/Protocol.hs
index 32065ff7..71f5b773 100644
--- a/src/Network/KRPC/Protocol.hs
+++ b/src/Network/KRPC/Protocol.hs
@@ -220,9 +220,8 @@ maxMsgSize :: Int
220maxMsgSize = 64 * 1024 -- bench: max UDP MTU 220maxMsgSize = 64 * 1024 -- bench: max UDP MTU
221{-# INLINE maxMsgSize #-} 221{-# INLINE maxMsgSize #-}
222 222
223-- TODO eliminate toStrict
224sendMessage :: BEncode msg => msg -> KRemoteAddr -> KRemote -> IO () 223sendMessage :: BEncode msg => msg -> KRemoteAddr -> KRemote -> IO ()
225sendMessage msg addr sock = sendAllTo sock (LB.toStrict (encoded msg)) addr 224sendMessage msg addr sock = sendManyTo sock (LB.toChunks (encoded msg)) addr
226{-# INLINE sendMessage #-} 225{-# INLINE sendMessage #-}
227 226
228recvResponse :: KRemote -> IO (Either KError KResponse) 227recvResponse :: KRemote -> IO (Either KError KResponse)