Hi, Spin another thread when you get the signal and make a connection back into your own server. This will unblock your accept. It's the only reliable way I have found to cleanly shutdown servers.
Karl --- In gsoap@yahoogroups.com, "feni...@..." <feni...@...> wrote: > > Good day > > I wrote standalone threaded gsoap server, and i have small problem. > Main thread waiting for connection and blocked in accept call. When i got > Signal (SIGTERM), i turn on flag, that i want to stop server. And if i have > no connections, main thread blocked by accept call. In signal documentation > said, that theoretical accept call will be terminated and unblocked, when > signal will arrive to application. But, this is only theoretical. I tried to > set " this->accept_timeout = 5; " (server on C++), but accept call > blocked. Can someone help? >