G+_Benjamin Breüner Frost Posted February 7, 2015 Share Posted February 7, 2015 hey everyone I'm trying to make a program in python that i can use to run scripts on my computer using my phone or some kind of other device. it is made up of a server and a client, and it is the client i have problems with. the client works fine when i use it on my computer. but on the phone it says "s.connect((host, port)) File "", line 1,in connect socket.error: [error 110] connection timed out. " i think the problem comes because i use python27 on my computer and sl4a on my phone uses python26. but i can't really find out what it is and i would be very happy if someone could help me fix it. the code is on github here https://github.com/benjamin1313/scriptLauncher/blob/master/scriptLuncherClient.py Link to comment Share on other sites More sharing options...
G+_Adrian Chung Posted February 15, 2015 Share Posted February 15, 2015 host = "localhost" port = 5070 This will work fine if both client and server are running on the same machine. Not if they are on different machines. If the phone is running its own service on port 5070, your client will try connecting with that instead. Did you remember to change "localhost" to the hostname or IP address of the computer on which the server is running? Link to comment Share on other sites More sharing options...
G+_Benjamin Breüner Frost Posted February 16, 2015 Author Share Posted February 16, 2015 i know the server runs fine. because i can connect too it with a telnet client but the code i wrote for the client doesn't work on my mobile and i have tried it using another computer that also runs python27 and then i works fine. Link to comment Share on other sites More sharing options...
G+_Adrian Chung Posted February 17, 2015 Share Posted February 17, 2015 Things to check: What network are the two computers and the phone connected to? Are they all WiFi on the same router? What routing rules have been configured on the router. Are IP addresses allocated dynamically or statically for each device? Or is the phone on cellular data? Link to comment Share on other sites More sharing options...
Recommended Posts