From 12a58f1922d30995019ca73c462f6a9937413f2b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 6 Dec 2016 15:49:39 -0400 Subject: need to auth with the peer --- P2P/IO.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'P2P') 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 -- cgit v1.2.3