
24 Jun
2012
24 Jun
'12
9:58 p.m.
How do you handle timeouts? If you use sendfile to send a large file (such as a video download) and it takes longer than the warp timeout period (30 seconds or something), won't warp kill the connection thinking that the connection has hung and no progress is being made? Or am I missing something?
Haskell network library opens a socket with the non-blocking flag set. So, the sendfile syscall returns if there is not enough write buffer. The sendfile function in simple-sendfile takes an IO function which is called when the sendfile syscall returns. Warp resets timeout via the IO function. --Kazu