aboutsummaryrefslogtreecommitdiff
path: root/P2P
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-12-06 15:49:39 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-12-06 15:50:02 -0400
commit12a58f1922d30995019ca73c462f6a9937413f2b (patch)
tree4e9a54d7ff0f4d3a204437ef295c67f7f97f5854 /P2P
parent5258f572d494d015c6c6e60c37a215bb95048bbd (diff)
need to auth with the peer
Diffstat (limited to 'P2P')
-rw-r--r--P2P/IO.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/P2P/IO.hs b/P2P/IO.hs
index f63b2808b..9abefb8a0 100644
--- a/P2P/IO.hs
+++ b/P2P/IO.hs
@@ -11,6 +11,7 @@ module P2P.IO
( RunProto
, P2PConnection(..)
, connectPeer
+ , closeConnection
, setupHandle
, runNetProto
, runNet
@@ -60,6 +61,11 @@ connectPeer g (TorAnnex onionaddress onionport) = do
, connOhdl = h
}
+closeConnection :: P2PConnection -> IO ()
+closeConnection conn = do
+ hClose (connIhdl conn)
+ hClose (connOhdl conn)
+
setupHandle :: Socket -> IO Handle
setupHandle s = do
h <- socketToHandle s ReadWriteMode