Fork me on GitHub
#aleph
<
2019-07-15
>
mccraigmccraig05:07:50

@runeb dyu mean you added a :timeout to the fast-echo-handler example s/connect ?

runeb20:07:40

@mccraigmccraig yes, precisely. I think the response from @hiredman explains perfectly why I did not see what I initially expected (timeout when lack of incoming data). If timeout is meant to address the tcp layer it makes sense.

mccraigmccraig20:07:10

manifold.stream/connect :timeout doesn't address the tcp layer... it's timing out a connection between streams, which in the case of the fast-echo-handler is a connection between the rx and tx sides of the tcp socket, but it's not a tcp layer timeout

runeb21:07:42

@mccraigmccraig hmmm in my test case outlined originally (connecting to the handler by way of telnet). Should I expect to see a disconnect from said time out in case I dont touch the keyboard?

mccraigmccraig21:07:14

no, i don't think so - the only thing being disconnected is the connection between the two streams based on the underlying socket channels - i don't think stream/connect :timeout closes its source or sink

mccraigmccraig21:07:48

do you observe that it stops echoing after the timeout?

runeb21:07:54

They dont close as far as i cant tell. I set the flags for closing also. I would like to see a disconnect on the telnet side. I need to kick clients that are not chatting for some set period and thought timeout was the answer. I made a watchdog to check "chattiness" of each connection and closing those that fail the timeout threshold. I am curious if this is the expected way of handling such conditions. I am not so sure what benefit I get from the current behavior of timeout? To set tcp socket timeout pr connection instead of on a system level? Do you know?

runeb21:07:36

Hope I make sense 🙂

mccraigmccraig22:07:35

can you show some code @runeb? easier to understand then...