Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6708659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:47:11+00:00 2026-05-26T07:47:11+00:00

I am using the following code to open a socket on my computer. When

  • 0

I am using the following code to open a socket on my computer. When I go to my_ip:5000 on my computer the program responds. However, when I use another computer, nothing happens.

HOST = 'my_ip'                 # Symbolic name meaning the local host
PORT = 8000              # Arbitrary non-privileged port
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((HOST, PORT))
s.listen(1)
conn, addr = s.accept()
print 'Connected by', addr
while 1:
    data = conn.recv(1024)
    if not data: break
    conn.send(data)
conn.close()

I’m not sure if this is an issue with the firewall or not. When I start up the test server in django using manage.py runserver my_ip:8000 I am able to connect to the machine from a different computer. I’m not sure what is causing me not to be able to connect from another computer using the code above…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T07:47:11+00:00Added an answer on May 26, 2026 at 7:47 am

    By setting HOST to 'my_ip', you may listen to a private IP that only resolves to your computer for your computer. The best-known example is 127.0.0.1. Instead, pass an empty string (HOST='') to listen to any requests coming in at the specified port. Make sure to use the same port number, i.e. either 5000 or 8000, on both machines.

    Also, check whether a firewall between the computers (or installed on one of them) prevents the connection.

    To test whether your computer is reachable in principle, run python -m SimpleHTTPServer in a directory without private information on the server and try to reach the webserver started with that from the client.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using following code to open a file dialog box, but nothing happens
I'm trying to open a socket on a host using the following code: $timeout
I've been using the following code to open Office Documents, PDF, etc. on my
I open a pop-up window using following code in main.html function openwindow(url) { window.open(url,
I have the following code: using (BinaryReader br = new BinaryReader( File.Open(FILE_PATH, FileMode.Open, FileAccess.ReadWrite)))
With the following file reading code: using (FileStream fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read,
I am using following code to open Android Contacts @Override public void onCreate(Bundle savedInstanceState)
I'm using following code to open the web.config of my current web application. Configuration
I am using the following code to open up an XML file so that
I am using the following code to open a file's contents and save it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.