WaitForRemote(int) is being called by nxagent/x2goagent. Thus, I should be rather debugging that and not nxproxy...
Sorry for sending the last eMail to the wrong bug number, Mike. I got confused with the threads and was adding the addressing manually. :(
However, I have good news for #515. I was able to fix the bug.
I'll be writing a roundup and attaching a patch, soon.