Remove timer hack from king<->serf protocol (should be fixed?)

This commit is contained in:
Benjamin Summers 2019-12-12 19:01:24 -08:00
parent 2a5f2a2d6e
commit acdd9b82f5

View File

@ -237,22 +237,13 @@ sendOrder w o = do
sendBytes :: HasLogFunc e => Serf e -> ByteString -> RIO e ()
sendBytes s bs = handle ioErr $ do
sendLen s (length bs)
hFlush (sendHandle s)
hack
hPut (sendHandle s) bs
hFlush (sendHandle s)
hack
where
ioErr :: IOError -> RIO e ()
ioErr _ = throwIO SerfConnectionClosed
-- TODO WHY DOES THIS MATTER?????
hack = threadDelay 10000
recvLen :: (MonadIO m, HasLogFunc e) => Serf e -> m Word64
recvLen w = io $ do
bs <- hGet (recvHandle w) 8