Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

199
Views
Python socket ipv6 over network not working

I am trying to connect a server to a client in python with sockets. The problem is that with ipv6 binding, it works on my local network. What I want is to connect it to another network. These programs are written in Python 3

Here is the code of server.py:

import socket

HOST = someip
PORT = someport

server = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
server.bind((HOST, PORT))

server.listen()

Source code of client.py:

import socket
HOST = someip
PORT = someport

client = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
client.connect((HOST, PORT))

I think it is a port forwarding problem. I know the code does nothing right now, but I want to first establish the connection.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

When the server receives a request, we need to put it in a loop to accept it. Like this

import socket

HOST = someip
PORT = someport

server = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
server.bind((HOST, PORT))
server.listen()
while True:
    try:
        conn, addr = server.accept()
        print(f"New request from {addr}")
    except KeyboardInterrupt:
        server.close()
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!