From 9d0f1f7976f74ed78c79e3dd4f10ee4308520931 Mon Sep 17 00:00:00 2001 From: voidlizard Date: Tue, 11 Feb 2025 10:27:32 +0300 Subject: [PATCH] wip --- hbs2-core/lib/HBS2/Net/Messaging/UDP.hs | 3 ++- hbs2-peer/app/PeerMain.hs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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