Hi Bogdan,
On Tue, Dec 16, 2014 at 6:19 PM, Bogdan Glinskiy <
fett...@gmail.com> wrote:
>> Well, unfortunately it's expected. Zerogw was never designed with
>> embedding in mind. So zerogw closes listening socket, but doesn't walk
>> connected sockets, because just exiting process works for zerogw.
>> Presumably working websockets may even crash the process. Do you need
>> to restart zerogw itself without restarting process? I don't believe
>> it's possible without huge amount of work.
>>
>
> Yes, i need to restart zerogw itself without restarting process... Well,
> from what side i should start? Should i modify zerogw sources?
>
First you need to patch libwebsite, to keep list of connections, and
close them on ws_socket_stop.
Then you need to check valgrinds output after you stop embedded
zerogw, to know whether all pieces of memory that zerogw had allocated
are free.
But I strongly advise you to consider either running zerogw in
subprocess, or do exec() system call to restart process in-place ,
instead of embedding
>
>>
>> Probably you changed current directory in the process. You can try to
>> configure absolute path to configuration.
>>
>
> Nope, as i said, my program doesn't change neither path nor configuration
> file. And i used kind of debug information about that during debugging my
> program.
> And i thing, this problem is caused by the problem i described above.
>
Try to run strace, and see which file is opened by zerogw. Probably
there is some garbage in memory instead of configuration file name.
--
Paul