diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2025-06-13 22:49:29 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2025-06-14 15:45:27 +0200 |
commit | 5b3c52c50b5301d009fb9a0d44b4cf91d50f6de4 (patch) | |
tree | 4814de0d56b7fe84da2ce507d24cfdf8e100f61e /src/Erebos/ICE.chs | |
parent | 7fa7cdeb5a8c0c784145df852da8ec4c18cb6e6b (diff) |
Terminate ICE thread when server is stoppedrelease-0.1
Changelog: Improved handling of ICE connections
Diffstat (limited to 'src/Erebos/ICE.chs')
-rw-r--r-- | src/Erebos/ICE.chs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Erebos/ICE.chs b/src/Erebos/ICE.chs index 6f61451..cc2fdcc 100644 --- a/src/Erebos/ICE.chs +++ b/src/Erebos/ICE.chs @@ -8,6 +8,7 @@ module Erebos.ICE ( IceRemoteInfo, iceCreateConfig, + iceStopThread, iceCreateSession, iceDestroy, iceRemoteInfo, @@ -138,6 +139,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 |