summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main/WebSocket.hs6
-rw-r--r--src/Erebos/ICE.chs1
-rw-r--r--src/Erebos/Network.hs1
3 files changed, 5 insertions, 3 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
diff --git a/src/Erebos/ICE.chs b/src/Erebos/ICE.chs
index bed186b..a3dd9bc 100644
--- a/src/Erebos/ICE.chs
+++ b/src/Erebos/ICE.chs
@@ -66,6 +66,7 @@ instance Show IceSession where
instance PeerAddressType IceSession where
sendBytesToAddress = iceSend
+ connectionToAddressClosed = iceDestroy
data IceRemoteInfo = IceRemoteInfo
diff --git a/src/Erebos/Network.hs b/src/Erebos/Network.hs
index 6126e60..e990fae 100644
--- a/src/Erebos/Network.hs
+++ b/src/Erebos/Network.hs
@@ -164,7 +164,6 @@ instance Eq Peer where
class (Eq addr, Ord addr, Show addr, Typeable addr) => PeerAddressType addr where
sendBytesToAddress :: addr -> ByteString -> IO ()
connectionToAddressClosed :: addr -> IO ()
- connectionToAddressClosed _ = return ()
data PeerAddress
= forall addr. PeerAddressType addr => CustomPeerAddress addr