From d8bec96d7ff43453f5ddda470ac80346a6c7e3c1 Mon Sep 17 00:00:00 2001 From: Sam Truzjan Date: Thu, 3 Oct 2013 15:56:31 +0400 Subject: Eliminate bytestring copying in sendMessage function --- src/Network/KRPC/Protocol.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') 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 maxMsgSize = 64 * 1024 -- bench: max UDP MTU {-# INLINE maxMsgSize #-} --- TODO eliminate toStrict sendMessage :: BEncode msg => msg -> KRemoteAddr -> KRemote -> IO () -sendMessage msg addr sock = sendAllTo sock (LB.toStrict (encoded msg)) addr +sendMessage msg addr sock = sendManyTo sock (LB.toChunks (encoded msg)) addr {-# INLINE sendMessage #-} recvResponse :: KRemote -> IO (Either KError KResponse) -- cgit v1.2.3