diff options
Diffstat (limited to 'src/Network/KRPC/Manager.hs')
-rw-r--r-- | src/Network/KRPC/Manager.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Network/KRPC/Manager.hs b/src/Network/KRPC/Manager.hs index 22d111e2..66de6548 100644 --- a/src/Network/KRPC/Manager.hs +++ b/src/Network/KRPC/Manager.hs | |||
@@ -466,14 +466,14 @@ handleMessage raw (E e) = handleResponse raw (Left e) | |||
466 | listener :: MonadKRPC h m => m () | 466 | listener :: MonadKRPC h m => m () |
467 | listener = do | 467 | listener = do |
468 | Manager {..} <- getManager | 468 | Manager {..} <- getManager |
469 | forever $ do | 469 | fix $ \again -> do |
470 | (bs, addr) <- liftIO $ do | 470 | (bs, addr) <- liftIO $ do |
471 | handle exceptions $ BS.recvFrom sock (optMaxMsgSize options) | 471 | handle exceptions $ BS.recvFrom sock (optMaxMsgSize options) |
472 | |||
473 | case BE.parse bs >>= \r -> (,) r <$> BE.decode bs of | 472 | case BE.parse bs >>= \r -> (,) r <$> BE.decode bs of |
474 | -- TODO ignore unknown messages at all? | 473 | -- TODO ignore unknown messages at all? |
475 | Left e -> liftIO $ sendMessage sock addr $ unknownMessage e | 474 | Left e -> liftIO $ sendMessage sock addr $ unknownMessage e |
476 | Right (raw,m) -> handleMessage raw m addr | 475 | Right (raw,m) -> handleMessage raw m addr |
476 | again | ||
477 | where | 477 | where |
478 | exceptions :: IOError -> IO (BS.ByteString, SockAddr) | 478 | exceptions :: IOError -> IO (BS.ByteString, SockAddr) |
479 | exceptions e | 479 | exceptions e |