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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:04:19+00:00 2026-06-04T07:04:19+00:00

I am a newbie to python, and just few days back I started trying

  • 0

I am a newbie to python, and just few days back I started trying my hands on network programming(I am a newbie there too)

Now I found a neat client server program which was running quite simply on my computer, but when I replaced the local addresses, and told my friend to run the client script, it just wont respond.

My global I.P address : 120.59.XX.XXX

My Ipv4 address as returned by ipconfig : 192.168.1.2 (I am connected to internet through a router)

My gateway address : 192.168.1.1

Port used : 1060 (I tested this port locally and it wasn’t in use)

#server.py

import socket
import sys

server = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

MAX = 65535
PORT = 1060

server.bind(('192.168.1.2', PORT))
print 'Listening at', server.getsockname()
while True:
    data, address = server.recvfrom(MAX)
    print 'The client at', address, 'says', repr(data)
    server.sendto('Your data was %d bytes' % len(data), address)

Client Code :

#client.py

import socket
import sys

client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

PORT = 1060
MAX = 65536

client.sendto('Hello Server!', ('120.59.XX.XXX', PORT))
data, address = client.recvfrom(MAX)
print 'The server', address, 'says', repr(data)

I started server.py on my computer and told my friend to start client.py, I allowed incoming connections to python through firewall, also I added 1060 port to windows incoming connections list.

Still it is not responding, and I am unable to decipher why(I have a dynamic IP address, but for the current session it remains constant and hence should work, also 1060 is a well known port and shouldn’t be a problem right?)

  • 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-06-04T07:04:20+00:00Added an answer on June 4, 2026 at 7:04 am

    You need to add a port forwarding rule in your router! something like from port 1060 forward to 192.168.1.2 port 1060.

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

Sidebar

Related Questions

i'm newbie for python programming, i'm having a .py file, now what shall i
Newbie question (I'm just getting started with Python and Pydev): I've created a project
I started using django framework just a few days ago and i desperately need
Newbie disclaimer: I am new to Python and just started using IDLE to play
I'm a newbie in Python and I'm studying list comprehension. What I'm trying to
Now following my series of python newbie questions and based on another question .
Hey there, was wondering if anyone could help a newbie on SQL and Python.
Python newbie here and wanted to know if there was a way to combine
I am just learning python and Qt these days. So please consider that this
I am a newbie - just reached the end of Learn Python the Hard

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.