python socket Windows 10 connection times out
up vote
0
down vote
favorite
We recently upgraded a windows computer to Windows 10 from Windows 7, doing a completely clean installation of the OS. When it ran Windows 7, we hosted a couple of simple python socket servers so that another Linux computer on the network could interface with certain drivers on the Windows machine. This system (of binding a socket server to an open port and listening for a response) worked perfectly for the year leading up to this upgrade.
When we updated the OS on the windows machine, the same python scripts that previously set up a SOCK_STREAM server connection between the two computers stopped functioning. When asked to connect, the connection simply times out.
Does anyone know any changes that might have impacted socket's ability to listen on Windows 10, and/or any fixes to this issue? In a lot of digging we have been able to turn up no apparent fixes.
Here is a basic example of the code being ran on each computer.
Windows 10:
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(("XX.XX.XX.XX", XXXXX))
s.listen()
while True:
conn, addr = s.accept()
try:
conn.settimeout(3)
data = conn.recv(1024)
except:
break
if not data:break
# more code follows to process the data, etc.
On Linux:
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(10) # this timeout can change, and it just hangs indefinitely when removed
s.connect(("XX.XX.XX.XX",XXXXX))
The IP and Port referenced above as a series of X's are available and do not throw any bugs.
python sockets windows-10
add a comment |
up vote
0
down vote
favorite
We recently upgraded a windows computer to Windows 10 from Windows 7, doing a completely clean installation of the OS. When it ran Windows 7, we hosted a couple of simple python socket servers so that another Linux computer on the network could interface with certain drivers on the Windows machine. This system (of binding a socket server to an open port and listening for a response) worked perfectly for the year leading up to this upgrade.
When we updated the OS on the windows machine, the same python scripts that previously set up a SOCK_STREAM server connection between the two computers stopped functioning. When asked to connect, the connection simply times out.
Does anyone know any changes that might have impacted socket's ability to listen on Windows 10, and/or any fixes to this issue? In a lot of digging we have been able to turn up no apparent fixes.
Here is a basic example of the code being ran on each computer.
Windows 10:
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(("XX.XX.XX.XX", XXXXX))
s.listen()
while True:
conn, addr = s.accept()
try:
conn.settimeout(3)
data = conn.recv(1024)
except:
break
if not data:break
# more code follows to process the data, etc.
On Linux:
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(10) # this timeout can change, and it just hangs indefinitely when removed
s.connect(("XX.XX.XX.XX",XXXXX))
The IP and Port referenced above as a series of X's are available and do not throw any bugs.
python sockets windows-10
90% of the time, this is a firewall issue, the other 10% is a firewall issue in the client machine
– yorodm
Nov 9 at 19:22
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
We recently upgraded a windows computer to Windows 10 from Windows 7, doing a completely clean installation of the OS. When it ran Windows 7, we hosted a couple of simple python socket servers so that another Linux computer on the network could interface with certain drivers on the Windows machine. This system (of binding a socket server to an open port and listening for a response) worked perfectly for the year leading up to this upgrade.
When we updated the OS on the windows machine, the same python scripts that previously set up a SOCK_STREAM server connection between the two computers stopped functioning. When asked to connect, the connection simply times out.
Does anyone know any changes that might have impacted socket's ability to listen on Windows 10, and/or any fixes to this issue? In a lot of digging we have been able to turn up no apparent fixes.
Here is a basic example of the code being ran on each computer.
Windows 10:
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(("XX.XX.XX.XX", XXXXX))
s.listen()
while True:
conn, addr = s.accept()
try:
conn.settimeout(3)
data = conn.recv(1024)
except:
break
if not data:break
# more code follows to process the data, etc.
On Linux:
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(10) # this timeout can change, and it just hangs indefinitely when removed
s.connect(("XX.XX.XX.XX",XXXXX))
The IP and Port referenced above as a series of X's are available and do not throw any bugs.
python sockets windows-10
We recently upgraded a windows computer to Windows 10 from Windows 7, doing a completely clean installation of the OS. When it ran Windows 7, we hosted a couple of simple python socket servers so that another Linux computer on the network could interface with certain drivers on the Windows machine. This system (of binding a socket server to an open port and listening for a response) worked perfectly for the year leading up to this upgrade.
When we updated the OS on the windows machine, the same python scripts that previously set up a SOCK_STREAM server connection between the two computers stopped functioning. When asked to connect, the connection simply times out.
Does anyone know any changes that might have impacted socket's ability to listen on Windows 10, and/or any fixes to this issue? In a lot of digging we have been able to turn up no apparent fixes.
Here is a basic example of the code being ran on each computer.
Windows 10:
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(("XX.XX.XX.XX", XXXXX))
s.listen()
while True:
conn, addr = s.accept()
try:
conn.settimeout(3)
data = conn.recv(1024)
except:
break
if not data:break
# more code follows to process the data, etc.
On Linux:
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(10) # this timeout can change, and it just hangs indefinitely when removed
s.connect(("XX.XX.XX.XX",XXXXX))
The IP and Port referenced above as a series of X's are available and do not throw any bugs.
python sockets windows-10
python sockets windows-10
asked Nov 9 at 19:03
Julien Luebbers
348
348
90% of the time, this is a firewall issue, the other 10% is a firewall issue in the client machine
– yorodm
Nov 9 at 19:22
add a comment |
90% of the time, this is a firewall issue, the other 10% is a firewall issue in the client machine
– yorodm
Nov 9 at 19:22
90% of the time, this is a firewall issue, the other 10% is a firewall issue in the client machine
– yorodm
Nov 9 at 19:22
90% of the time, this is a firewall issue, the other 10% is a firewall issue in the client machine
– yorodm
Nov 9 at 19:22
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
This is a firewall issue (like @yorodm said), so it is not the Python code that is making the mistake, it's the computer.
I can't give a solution for the Linux computer (I assume that it is running correctly, with the firewall allowing incoming connections), but I can for the Windows 10 computer.
So here is a solution:
Go to Start, and start Cortana. Type in "Allow an app through Windows Firewall", then tap the "Enter" key. Click on the "change settings" button, and next to "python.exe", check the box to the left, and if it isn't already enabled, the two to the right of python.exe.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
This is a firewall issue (like @yorodm said), so it is not the Python code that is making the mistake, it's the computer.
I can't give a solution for the Linux computer (I assume that it is running correctly, with the firewall allowing incoming connections), but I can for the Windows 10 computer.
So here is a solution:
Go to Start, and start Cortana. Type in "Allow an app through Windows Firewall", then tap the "Enter" key. Click on the "change settings" button, and next to "python.exe", check the box to the left, and if it isn't already enabled, the two to the right of python.exe.
add a comment |
up vote
0
down vote
accepted
This is a firewall issue (like @yorodm said), so it is not the Python code that is making the mistake, it's the computer.
I can't give a solution for the Linux computer (I assume that it is running correctly, with the firewall allowing incoming connections), but I can for the Windows 10 computer.
So here is a solution:
Go to Start, and start Cortana. Type in "Allow an app through Windows Firewall", then tap the "Enter" key. Click on the "change settings" button, and next to "python.exe", check the box to the left, and if it isn't already enabled, the two to the right of python.exe.
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
This is a firewall issue (like @yorodm said), so it is not the Python code that is making the mistake, it's the computer.
I can't give a solution for the Linux computer (I assume that it is running correctly, with the firewall allowing incoming connections), but I can for the Windows 10 computer.
So here is a solution:
Go to Start, and start Cortana. Type in "Allow an app through Windows Firewall", then tap the "Enter" key. Click on the "change settings" button, and next to "python.exe", check the box to the left, and if it isn't already enabled, the two to the right of python.exe.
This is a firewall issue (like @yorodm said), so it is not the Python code that is making the mistake, it's the computer.
I can't give a solution for the Linux computer (I assume that it is running correctly, with the firewall allowing incoming connections), but I can for the Windows 10 computer.
So here is a solution:
Go to Start, and start Cortana. Type in "Allow an app through Windows Firewall", then tap the "Enter" key. Click on the "change settings" button, and next to "python.exe", check the box to the left, and if it isn't already enabled, the two to the right of python.exe.
answered Nov 9 at 20:20
MilkyWay90
7810
7810
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53231849%2fpython-socket-windows-10-connection-times-out%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
90% of the time, this is a firewall issue, the other 10% is a firewall issue in the client machine
– yorodm
Nov 9 at 19:22