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 882311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:24:27+00:00 2026-05-15T12:24:27+00:00

I am trying to make a simple server/client program pair. On LAN they work

  • 0

I am trying to make a simple server/client program pair.
On LAN they work fine, but when i try to connect from the “outside” it says connection refused. I shut down firewalls on both machines but i am still unable to connect, and i double checked the ip.

What am i doing wrong?

Thanks

Jake

Code:

import socket 
host = '' 
port = 9888 
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 
s.bind((host,port))     
s.listen(1) 
conn, adrr = s.accept() 
conn.send("Hello, world!") 
s.close() 

Client: 
import socket 
host = '68.x.x.x'
port = 9888
s = socket.socket(socket.AF_INET, socket_SOCK_STREAM)
s.connect((host,port)) 
print s.recv(200) 
s.close() 
  • 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-15T12:24:27+00:00Added an answer on May 15, 2026 at 12:24 pm

    You have one of two possible issues.

    1. Erroneous network configuration
    2. Bug(s) in code

    The way to debug this is to try and rule one out. If we can get rid of the Code issue then we know it is a network issue.

    Get a Socket Server and client that you know works and then try them as standalone programs. inside and outside of the firewall.
    Go to this site and download the examples. Change the ports in both the client and the server, compile and run them. First on same machine within network, second from two machines on same network and then server from within and client from outside of network.

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

Sidebar

Related Questions

I am trying to make a simple Client-Server application but when I execute the
I am trying to make a simple client-server chat program. On the client side
I'm trying to make a simple client & server messaging program in python, and
I'm trying to make a simple UDP client server example in PHP but I
I'm trying for a week to make my XSP server work with simple static
I am trying to make a simple lua socket client for the Socket Server
I'm trying to make a simple msn client mostly for fun but also for
I'm trying to make a simple chat program between to programs on a lan.
I'm trying to make a simple http client server using java. It will show
I am trying to make a simple TCP client and host chat program in

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.