From: Ramakrishnan Muthukrishnan Date: Sun, 12 Jun 2016 06:27:37 +0000 (+0530) Subject: UDP tracker: close session function X-Git-Url: https://git.rkrishnan.org/simplejson/components/com_hotproperty/frontends/%22file:/?a=commitdiff_plain;h=6153b8f5fadd974331a17efed81fa1cba0ee739c;p=functorrent.git UDP tracker: close session function --- 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