Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Server is throwing me an error

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am trying to client server program using python. Below is the code which I found online. but it's throwing me an error at s.bind((host, port))  




Below is the error which I got.

Traceback (most recent call last):
 File "python", line 52, in <module>
socket.gaierror: [Errno -3] Temporary failure in name resolution

Let me know where I am doing wrong.

FYI I don't have any python set up in my local. I am practicing it online (https://repl.it )
 
Ranch Hand
Posts: 271
15
Android Angular Framework Spring AngularJS Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Somashaker:
I have not done much with Python or Jython (only a little).  But If I were you, I would try printing the host name provided.  Also, I would concentrate on that error message "Temporary failure in name resolution".  This sounds superficially like a DNS problem (deeper research might yield something different).  The kinds of things that can affect DNS lookups (to my own knowledge) are:

* No DNS available at all. You can check that by just pinging a well-known host that would have to be looked up by name.
* Proxy server.  Do you have a proxy you have to go through?
* /etc/hosts file.

If you are convinced this downloaded code is OK (no idea, here), then this is probably something to do with the server setup.

HTH
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried this code on my local machine and it appears to work fine:





My wild guess is that repl.it blocks server functions like binding to a socket, which makes sense to prevent malicious exploits
 
It's weird that we cook bacon and bake cookies. Eat this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic