Re: Disconnecting clients from SoupServer



Hi

Thanks, that is what I guessed, but it is nice having it confirmed.

But can you verify that calling soup_socket_disconnect() from the right place should work well for disconnecting non-responsive clients?

And will everything be disconnected and cleaned up after soup_socket_disconnect() has returned? Or will this emit signals that are handled later?

Is it safe to call soup_socket_disconnect() from glib signal handlers, e.g. from the SoupMessage::wrote-body-data or SoupSocket::writable signals? Do I risk infinite loops or other ugly things by doing that?

I have been using a GAsyncQueue to trigger execution in the GMainLoop. That works well for soup_message_body_append(). It did fail badly for soup_socket_disconnect(), but I assumed that everything was cleaned up after it returned, and did not expect any signals emitted for the SoupMessage afterwards. That might have been the cause of the problems.

Regards
Rune Sætre


On Tue, 21 Sep 2010, Dan Winship wrote:

On 09/20/2010 07:46 PM, Rune Saetre wrote:
Is it safe calling soup_socket_disconnect() from a different thread than
the one running GMainLoop?

No, SoupServer isn't thread-safe. You'd have to add an idle handler to
the server's main context, and call soup_socket_disconnect() from there.

(And if that doesn't work, then file a bug.)

-- Dan
_______________________________________________
libsoup-list mailing list
libsoup-list gnome org
http://mail.gnome.org/mailman/listinfo/libsoup-list


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]