Skip to content

Commit

Permalink
fix to reading of datagram length
Browse files Browse the repository at this point in the history
  • Loading branch information
vojiranto committed Jan 11, 2019
1 parent 76d4d7b commit d9ca662
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Enecuum/Framework/Networking/Internal/Datagram.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ receiveDatagram sock = do
pure $ mconcat $ reverse rawMsg

readMsg :: S.Socket -> Either String Word32 -> IO [LByteString]
readMsg _ (Left err) = error $ "Decoding error " <> toText err
readMsg _ (Left _ ) = pure []
readMsg sock (Right len) =
loopM (\(elemsOfMsg, restOfMsg) -> do
msg <- S.recv sock ((toEnum.fromEnum) restOfMsg)
Expand Down

0 comments on commit d9ca662

Please sign in to comment.