summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2025-07-17 21:39:22 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2025-07-17 21:39:22 +0200
commitd438e42a8047c3ea37ec2f0eaa8010fb22fc21d6 (patch)
tree7b400e787139d12fd4f70250825278536b84aa9a /main
parentf87fdcc65008fb40e8f0f37f33f6bbae1afa162a (diff)
Destroy ICE and close WS sessions on connection termination
Diffstat (limited to 'main')
-rw-r--r--main/WebSocket.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/main/WebSocket.hs b/main/WebSocket.hs
index 5c49aa1..7a957e2 100644
--- a/main/WebSocket.hs
+++ b/main/WebSocket.hs
@@ -27,8 +27,10 @@ instance Show WebSocketAddress where
show (WebSocketAddress _ _) = "websocket"
instance PeerAddressType WebSocketAddress where
- sendBytesToAddress (WebSocketAddress _ conn) msg = do
- WS.sendDataMessage conn $ WS.Binary $ BL.fromStrict msg
+ sendBytesToAddress (WebSocketAddress _ conn) msg = do
+ WS.sendDataMessage conn $ WS.Binary $ BL.fromStrict msg
+ connectionToAddressClosed (WebSocketAddress _ conn) = do
+ WS.sendClose conn BL.empty
startWebsocketServer :: Server -> String -> Int -> (String -> IO ()) -> IO ()
startWebsocketServer server addr port logd = do