summaryrefslogtreecommitdiff
path: root/dht/src
diff options
context:
space:
mode:
Diffstat (limited to 'dht/src')
-rw-r--r--dht/src/Data/Tox/Onion.hs1
-rw-r--r--dht/src/Network/QueryResponse/TCP.hs5
2 files changed, 6 insertions, 0 deletions
diff --git a/dht/src/Data/Tox/Onion.hs b/dht/src/Data/Tox/Onion.hs
index bd802c75..0338111b 100644
--- a/dht/src/Data/Tox/Onion.hs
+++ b/dht/src/Data/Tox/Onion.hs
@@ -848,6 +848,7 @@ data OnionRoute = OnionRoute
848 , routeNodeC :: NodeInfo 848 , routeNodeC :: NodeInfo
849 , routeRelayPort :: Maybe PortNumber 849 , routeRelayPort :: Maybe PortNumber
850 } 850 }
851 deriving Show
851 852
852 853
853wrapOnion :: Serialize (Forwarding n msg) => 854wrapOnion :: Serialize (Forwarding n msg) =>
diff --git a/dht/src/Network/QueryResponse/TCP.hs b/dht/src/Network/QueryResponse/TCP.hs
index e4831fb2..fdca86b4 100644
--- a/dht/src/Network/QueryResponse/TCP.hs
+++ b/dht/src/Network/QueryResponse/TCP.hs
@@ -175,6 +175,11 @@ closeAll tcpcache stream = do
175 case r of TCPSession{tcpState=st,tcpHandle=h} -> streamGoodbye st >> hClose h 175 case r of TCPSession{tcpState=st,tcpHandle=h} -> streamGoodbye st >> hClose h
176 _ -> return () 176 _ -> return ()
177 177
178-- Use a cache of TCP client connections for sending (and receiving) packets.
179-- The boolean value prepended to the message allows the sender to specify
180-- whether or not a new connection will be initiated if neccessary. If 'False'
181-- is passed, then the packet will be sent only if there already exists a
182-- connection.
178tcpTransport :: Int -- ^ maximum number of TCP links to maintain. 183tcpTransport :: Int -- ^ maximum number of TCP links to maintain.
179 -> StreamHandshake addr x y 184 -> StreamHandshake addr x y
180 -> IO (TCPCache (SessionProtocol x y), TransportA err addr x (Bool,y)) 185 -> IO (TCPCache (SessionProtocol x y), TransportA err addr x (Bool,y))