42

I have been trying to connect two computers together using Python and pass information between them. While I have a broad grasp of Python, my networking knowledge (stuff like public/private IP addresses, port forwarding etc.) was pretty limited. It took me a very long time to figure out how to get it to work across two different networks.

There are at least 17 questions on SO all asking this exact question, and none of the answers were much help to me. The real issue here is that the answer isn't so much to do with Python as to do with networking (port forwarding). So Googling "Python Sockets how to connect 2 networks together" doesn't help.

What is the correct protocol for dealing with this? Do we get them all closed as duplicates? Should I create a new canonical question + answer pair?

Here are the ones I found:

Can sockets be used to connect multiple computers on different networks in python?

Python 2.7 Socket connection on 2 different networks?

Python : How to connect socket on different network

socket programing cant connect to another network

How to connect two different computers on different networks with socket in Python?

Connecting two sockets in different networks in python

https://stackoverflow.com/questions/35141806/how-can-i-connect-two-computers-on-different-networks-using-python-socket

Communication between two computers using python socket

Python Socket connection over 2 different networks

Can't connect to python server from another machine

Unable To Connect Python Sockets On Different Computers

how to connect two different computers in two different networks

Python: sending data between two computers via sockets

Python Socket Connection to networked computer

Python/socket: How to send a file to another computer which is on a different network?

Python sockets will not connect

Can't connect to python socket server on a different network

3
  • 13
    "the answer isn't so much to do with Python as to do with networking (port forwarding)" -- so, completely off-topic for Stack Overflow, as port forwarding is a network admin issue, not a programming issue. Why should we care about these? I mean, closing them as off-topic would be appropriate, and I guess if we can find the people to cast the votes, that's great. But sheesh...Stack Overflow is filled with bad questions that should've been closed long ago, and which never will be. Why are these 17+ a priority? Commented Dec 21, 2017 at 22:39
  • 11
    @PeterDuniho Hmmm... This seems to be one of those gray areas to me. The askers explicitly arrived at the problem while writing code. A socket is a construct used to communicate across boundaries (process or network usually); it's not something that's strictly implemented by the OS. HTTP requests are clearly not off topic, for another example. Do they necessarily know it's a network issue? And if they don't, is it inappropriate to provide some kind of answer pointing them to the next thing they should research?
    – jpmc26
    Commented Dec 22, 2017 at 11:15
  • Does Googling for answers without specifying Python, then translating, help?
    – jscs
    Commented Dec 22, 2017 at 15:16

0

You must log in to answer this question.

Browse other questions tagged .