Skip to content
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

Feature - Server Name #210

Open
tinylama opened this issue Jan 18, 2022 · 1 comment
Open

Feature - Server Name #210

tinylama opened this issue Jan 18, 2022 · 1 comment

Comments

@tinylama
Copy link

tinylama commented Jan 18, 2022

I can see we have in RFB server name, it would be great if we could return that.

I assume something like this would do it:

rfb.py:

    @property
    def get_name(self):
        return self.name

client.py:

    def get_server_name(self):
        """ Return server name as String 
        """
        return self.get_name.decode("utf-8", errors="ignore")
@pmhahn
Copy link
Collaborator

pmhahn commented Dec 20, 2022

This first part is not required as this is Python and not Java: No need to add that property as self.name can be accessed directly in client.py:

    def get_server_name(self) -> str:
        """ Return server name as String 
        """
        return self.name.decode("utf-8", errors="ignore")

Or not even that as you can can just use client.name.decode() in your code; as of Python 3.7 utf-8 is the default anyway.

@pmhahn pmhahn added the feature label Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants