diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2013-10-03 15:56:31 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2013-10-03 15:56:31 +0400 |
commit | d8bec96d7ff43453f5ddda470ac80346a6c7e3c1 (patch) | |
tree | 5728617851fb247e39d252cc814d1b73f45bf2fb /src/Network/KRPC/Protocol.hs | |
parent | 908a20ca2880a9047f7fbf07e33f18caf53f5109 (diff) |
Eliminate bytestring copying in sendMessage function
Diffstat (limited to 'src/Network/KRPC/Protocol.hs')
-rw-r--r-- | src/Network/KRPC/Protocol.hs | 3 |
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 | |||
220 | maxMsgSize = 64 * 1024 -- bench: max UDP MTU | 220 | maxMsgSize = 64 * 1024 -- bench: max UDP MTU |
221 | {-# INLINE maxMsgSize #-} | 221 | {-# INLINE maxMsgSize #-} |
222 | 222 | ||
223 | -- TODO eliminate toStrict | ||
224 | sendMessage :: BEncode msg => msg -> KRemoteAddr -> KRemote -> IO () | 223 | sendMessage :: BEncode msg => msg -> KRemoteAddr -> KRemote -> IO () |
225 | sendMessage msg addr sock = sendAllTo sock (LB.toStrict (encoded msg)) addr | 224 | sendMessage msg addr sock = sendManyTo sock (LB.toChunks (encoded msg)) addr |
226 | {-# INLINE sendMessage #-} | 225 | {-# INLINE sendMessage #-} |
227 | 226 | ||
228 | recvResponse :: KRemote -> IO (Either KError KResponse) | 227 | recvResponse :: KRemote -> IO (Either KError KResponse) |