summaryrefslogtreecommitdiff
path: root/src/Erebos/ICE.chs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2025-06-13 22:49:29 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2025-06-14 09:50:39 +0200
commit1c4251052feb63adf6f54a1269cbedd546ff9797 (patch)
tree93f3ab6e8c50913ea8990d797f307e333d64f5da /src/Erebos/ICE.chs
parentd24223e204bedfa4f0e57db55b039cffa9811357 (diff)
Terminate ICE thread when server is stopped
Changelog: Improved handling of ICE connections
Diffstat (limited to 'src/Erebos/ICE.chs')
-rw-r--r--src/Erebos/ICE.chs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Erebos/ICE.chs b/src/Erebos/ICE.chs
index 2c6f500..dceeb2c 100644
--- a/src/Erebos/ICE.chs
+++ b/src/Erebos/ICE.chs
@@ -8,6 +8,7 @@ module Erebos.ICE (
IceRemoteInfo,
iceCreateConfig,
+ iceStopThread,
iceCreateSession,
iceDestroy,
iceRemoteInfo,
@@ -139,6 +140,12 @@ iceCreateConfig stun turn =
then return Nothing
else Just . IceConfig <$> newForeignPtr ice_cfg_free cfg
+foreign import ccall unsafe "pjproject.h ice_cfg_stop_thread"
+ ice_cfg_stop_thread :: Ptr PjIceStransCfg -> IO ()
+
+iceStopThread :: IceConfig -> IO ()
+iceStopThread (IceConfig fcfg) = withForeignPtr fcfg ice_cfg_stop_thread
+
{#pointer *pj_ice_strans as ^ #}
iceCreateSession :: IceConfig -> IceSessionRole -> (IceSession -> IO ()) -> IO IceSession