Thanks for the feedback - the timer is a great idea, I hadn't thought of. An implementation question: when my timer callback function is called, a handle is passed. I need to free this handle at end of callback routine, correct?
On Tuesday, July 21, 2020 at 1:20:32 PM UTC-5, Ariel Machado wrote: > > Some hints: > * Don't use the event loop from the main thread in another thread. Libuv > is not-thread safe. > * You don't need to create a thread to execute the heartbeat, use a timer > (uv_timer) to repeat the request. > * Your code must support connection drop and reconnect even in http 1.1. > Send a header Connection: keep-alive to keep the connection open for Http > 1.0 server. > * every time that the timer runs check connection dropped and reconnect > it. When connected or if already connected send the heartbeat requested. > * You detect a connection dropped by status on uv_read_start callback. > -- You received this message because you are subscribed to the Google Groups "libuv" group. To unsubscribe from this group and stop receiving emails from it, send an email to libuv+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/libuv/ff612aa5-8852-4d2d-acb4-fdc9c5079ab2o%40googlegroups.com.