plptools
Loading...
Searching...
No Matches
Todo List
Member link_thread (void *arg)
There's something really nuanced going on with the use of the NCPSession::socketChannelWatch_ here. Specifically, while it might look like it's just being used as a timeout (which might be the intent), new TCP sockets are added to it on a successful accept, meaning that this will wake up frequently whenever there's activity on the socket. This will cause frequent NCP::hasFailed checks, and very timely resets (NCP::reset) whenever a client is connected. It's possible this was introduced as a work-around to connectivity issues. It is also worth noting that IOWatch is not thread-safe, so using it in link_thread, and adding to it in ncp_session_main_thread (as we are doing) is definitely a bad thing.