Re: [gtk-vnc-devel] disconnect signal



Jonh Wendell wrote:
Em Ter, 2007-09-11 às 20:05 +0100, Daniel P. Berrange escreveu:
On Tue, Sep 11, 2007 at 03:55:13PM -0300, Jonh Wendell wrote:
Hi, folks.

What do you think about change the way the 'disconnect' signal is
emitted? I think it should be raised only if the connection is lost, or
if the server closes the connection.

If i close the connection by myself, or if i close the whole program, i
don't want to receive a 'you were disconnected' signal.

Was i clear? I don't know if what i have in mind should be implemented
like i said or by adding another type of signal...
I intended the disconnect signal to be used to track the 'lifecycle' of
a connection and as such I think it should always be emitted, no matter
how the connection was closed.

OK, no problem, but:

One thing I do want to add though is a 'error' signal which would be emitted
whenever anything goes wrong in the client (ie anywhere the code which sets
the has_error flag to TRUE). In particular this signal would include some
kind of info about what failed - perhaps just the 'strerror(errno)' data or
a message generated by our own code for some semantic error eg "Unsupported
protocol version", or "Supported authentiction method", or 'Remote server
closed connection". Would a general 'error' signal solve the issue you want
to address ?  The 'error' signal would of course be immediately followed by
the 'disconnected' signal too.
Dan.

Indeed again, but, in this case, the 'disconnected' signal is useless in
my opinion.

I agree with Dan. I think simpler semantics is always better. Disconnected doesn't necessarily mean error.

I was about to ask for a 'auth error' signal, but this 'error' signal is
more generic and i think it solves my problems.

I don't much like the idea of an "error" signal. It means that you end up with a catch-all handler.

You definitely want a separate authentication-error signal. For the case where the server prematurely closes the connection, and unexpected-end-of-file signal or something similar would be useful. Note that an unexpected EOF is not the same as disconnected.

In this case, we should start i18n for gtk-vnc, in order to have the
error messages translated.

Why would there be string messages at the gtk-vnc level? gtk-vnc should produce machine readable errors and then the user of gtk-vnc should translate that into a human-readable error message.

Regards,

Anthony Liguori

Also, it would be nice having a table of error code available in
vncdisplay.h, in case the application which receives the signal chooses
not to display an specific error.

Cheers,





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