From 6153b8f5fadd974331a17efed81fa1cba0ee739c Mon Sep 17 00:00:00 2001
From: Ramakrishnan Muthukrishnan <ram@rkrishnan.org>
Date: Sun, 12 Jun 2016 11:57:37 +0530
Subject: [PATCH] UDP tracker: close session function

---
 src/FuncTorrent/Tracker/Udp.hs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/FuncTorrent/Tracker/Udp.hs b/src/FuncTorrent/Tracker/Udp.hs
index 7467ce8..e24944a 100644
--- a/src/FuncTorrent/Tracker/Udp.hs
+++ b/src/FuncTorrent/Tracker/Udp.hs
@@ -31,7 +31,7 @@ import Data.ByteString (ByteString)
 import qualified Data.ByteString.Char8 as BC
 import Data.ByteString.Lazy (fromStrict, toStrict)
 import Data.Word (Word32, Word64)
-import Network.Socket (Socket, Family( AF_INET ), SocketType( Datagram ), defaultProtocol, SockAddr(..), socket, inet_addr)
+import Network.Socket (Socket, Family( AF_INET ), SocketType( Datagram ), defaultProtocol, SockAddr(..), socket, inet_addr, close)
 import Network.Socket.ByteString (sendTo, recvFrom)
 import System.Random (randomIO)
 
@@ -169,5 +169,5 @@ startSession ip port = do
                             , tid = r
                             , addr = (SockAddrInet (fromIntegral port) hostAddr) }
   
--- closeSession :: UDPTrackerHandle
-
+closeSession :: UDPTrackerHandle -> IO ()
+closeSession (UDPTrackerHandle s _ _) = close s
-- 
2.45.2