Hi I want to use the following lib in Haskell for transferring files between nodes : https://hackage.haskell.org/package/sendfile-0.7.11.1/docs/Network-Socket-SendFile.html
I want to be able to abort the sendFile
if the file has been transferred by another node basically...
I was thinking using the iteratee for doing it like in this example :
runIter :: IO Iter -> IO ()
runIter iter =
do r <- iter
case r of
(Done _n) -> return ()
(Sent _n cont) -> runIter cont
(WouldBlock _n fd cont) ->
do threadWaitWrite fd
runIter cont
My question is : How can I abort this transfert ?
I was thinking doing something like this :
(Sent _n cont) -> return ()
or
(Sent _n cont) -> error "Already downloaded (Abort)"
Basically having a way for the client to know the call has been aborted...
Nothing is explained in the lib for implementing that kind of behaviour...