From c0b6b785596df15d3bf48cd5aba171a5d1bccd23 Mon Sep 17 00:00:00 2001 From: Joe Crayne Date: Sat, 25 Jan 2020 17:13:58 -0500 Subject: Only one session at a time (per DHT node). --- dht/src/Network/Tox/Session.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'dht/src/Network/Tox/Session.hs') diff --git a/dht/src/Network/Tox/Session.hs b/dht/src/Network/Tox/Session.hs index 53d63287..1b1c62c4 100644 --- a/dht/src/Network/Tox/Session.hs +++ b/dht/src/Network/Tox/Session.hs @@ -6,6 +6,7 @@ module Network.Tox.Session , SessionKey , Session(..) , sTheirUserKey + , sTheirDHTKey , sClose , handshakeH ) where @@ -95,6 +96,10 @@ sTheirUserKey s = longTermKey $ runIdentity cookie where Cookie _ cookie = handshakeCookie (sReceivedHandshake s) +sTheirDHTKey :: Session -> PublicKey +sTheirDHTKey s = case handshakeCookie $ sReceivedHandshake s of + Cookie _ (Identity cd) -> dhtKey cd + -- | Helper to close the 'Transport' associated with a session. sClose :: Session -> IO () sClose s = do -- cgit v1.2.3