diff --git a/hbs2-core/lib/HBS2/Net/Messaging/UDP.hs b/hbs2-core/lib/HBS2/Net/Messaging/UDP.hs index 4bcdd8b9..60384d99 100644 --- a/hbs2-core/lib/HBS2/Net/Messaging/UDP.hs +++ b/hbs2-core/lib/HBS2/Net/Messaging/UDP.hs @@ -42,7 +42,8 @@ newMessagingUDPMulticast s = runMaybeT $ do (host, port) <- MaybeT $ pure $ getHostPort (Text.pack s) - so <- liftIO $ multicastReceiver host port + so <- liftIO (try @_ @SomeException $ multicastReceiver host port) + >>= toMPlus liftIO $ setSocketOption so ReuseAddr 1 diff --git a/hbs2-peer/app/PeerMain.hs b/hbs2-peer/app/PeerMain.hs index 7eb4f3b3..e9baec45 100644 --- a/hbs2-peer/app/PeerMain.hs +++ b/hbs2-peer/app/PeerMain.hs @@ -844,7 +844,7 @@ runPeer opts = respawnOnError opts $ do mcast <- newMessagingUDPMulticast defLocalMulticast - `orDie` "Can't start RPC listener" + `orDie` "Can't start multicast listener" messMcast <- async $ runMessagingUDP mcast