This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques and have Mario Casciaro & Luciano Mammino on-line!
See this thread for details.
Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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: 269
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
 
I’m tired of walking, and will rest for a minute and grow some wheels. This is the promise of this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic