-
-
Notifications
You must be signed in to change notification settings - Fork 494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[libvncclient] Please consider adding a lastError field to rfbClient #577
Comments
This is a cool feature, I'm working on it. But some details need to be explained, to avoid breaking changes. enum rfbClientErr {
EINVALIDPASSWD,
EINVALIDCLIENT,
...
} |
@nicmorais Thanks so much for looking into this. It has been a while since I submitted this, so I will try to explain better... In my app, SpiritVNC-FLTK, I can have multiple connections running at the same time. Right now, libvncclient only logs errors to the general logging facility, instead of setting a per-connection error code or string. This makes it difficult to let the user know what specific error happened per-connection / per-client because libvncclient's logging facility doesn't always specify things like IP address, etc. Basically I would like to see something similar to gtk-vnc -- you can connect gtk-vnc's error signal to a callback and handle the error as you wish. I am not looking for any additional errors to be added, I just want the ability to handle the error text libvncclient already has for each client's error separately. For example, gtk-vnc's error handler signature is like this: static void vnc_error(GtkWidget *vncdisplay, const gchar *message)
{
fprintf(stderr, "Error: %s\n", message);
} It would be great if libvncclient provided:
Hopefully this makes sense. If not, please ask me for specific details and I will try my best 👍 Thanks! 😄 |
Hello @willbprog127 Thanks! |
I will just give a few error codes because I have a tiny brain and not an rfb master:
Sorry, cannot think of others right now. 🤷♂️ 👍 |
While libvncclient does output errors (such as failed authentication) when used with logging facility, it is almost impossible to identify the precise rfbClient logging the error. In my app, there can be dozens of rfbClient instances at once so the general logging facility that libvncclient provides is inadequate. While most errors mention the IP address, this is not enough to identify an exact rfbClient because some of them have the same IP address but different ports.
I would like to see the addition of a
lastError
char *
field added to the rfbClient structure that is set any time there is an error with that rfbClient.Maybe the rfbClientLog facility could be modified to set the
lastError
of the rfbClient, cutting down on duplicate strings, etc, with an example signature ofrfbDefaultClientLog(rfbClient* client, const char* format, ...)
. Consider the following (very oversimplified) example:and
Again, I have thought about using the IP address given in the logged error messages to identify, but this is not enough information when I have some remote facilities that have the same IP address but different ports.
Thanks! 👍
The text was updated successfully, but these errors were encountered: