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

run client but get "socket.timeout:timed out",client and server are not on the same computer #425

Closed
alan2yang opened this issue Dec 25, 2020 · 1 comment
Assignees
Labels
Done The issue discussion is exhausted and is closed w/ comment

Comments

@alan2yang
Copy link

stack trace / error log

run client but get "socket.timeout:timed out"

Environment
  • rpyc version 4.1.5
  • python version 3.7
  • operating system windows10
Minimal example

Server ( ip is 192.168.0.123):

import rpyc
from rpyc.utils.server import OneShotServer


class HelloService(rpyc.Service):
    def exposed_concat(self, remote_str):
        local_str = ' github'
        return remote_str + local_str


if __name__ == "__main__":
    server = OneShotServer(HelloService, port=12345)
    server.start()

Client (on another computer):

import rpyc


if __name__ == "__main__":
    c = rpyc.connect("192.168.0.123", 12345)
    print(c.root.concat('hello'))
@comrumino comrumino self-assigned this Dec 26, 2020
@comrumino comrumino added the To Start Description reviewed and a maintainer needs "to start" triage label Dec 26, 2020
comrumino added a commit that referenced this issue Dec 26, 2020
…v6 support by introducing getaddrinfo; one consequence of using getaddrinfo is that the address for hostname relies on the underlying C-API. A hostname of "" throws an error on linux but not on windows. Hence, the default value of hostname was change to None resulting in the default address becoming localhost. By adding the AI_PASSIVE flag, a hostname of None will result in a wildcard address (INADDR_ANY for IPv4 addresses, IN6ADDR_ANY_INIT) is used by applications to listen on all interfaces.
@comrumino comrumino added Done The issue discussion is exhausted and is closed w/ comment and removed To Start Description reviewed and a maintainer needs "to start" triage labels Dec 26, 2020
@comrumino
Copy link
Collaborator

Thanks for reporting! The commit message for de0c515 explains some context and the root cause of this issue. In short, I added socket.getaddrinfo to fix IPv6 support and changed the default behavior to bind to local host instead of the wildcard address. Until the next release, a workaround is to specify the hostname as 0.0.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Done The issue discussion is exhausted and is closed w/ comment
Projects
None yet
Development

No branches or pull requests

2 participants