Linked Questions

10 questions linked to/from Python socket connection timeout
1 vote
0 answers
56 views

I am trying to do a port test using the python socket library. The object uses connect_ex((ip,port)), and the result is immediately displayed in case of success but waits for about 2 minutes in case ...
5 votes
2 answers
15k views

I am writing a very simple udp socket connection in Python 2.7 The server side is up and running. I have trouble on the client side. from socket import * serverName = '127.0.0.1' serverPort = 5444 ...
3 votes
1 answer
9k views

I'm starting to learn python socket and the TCP/IP model, so I'm at very beginning. I have this simple piece of code that works correctly as expected: import socket from datetime import datetime s = ...
1 vote
2 answers
4k views

This is my python modbus tcp communication code and it wait at the this line and than stopping for the connection where is my fault: sock.connect((TCP_IP, TCP_PORT)) (if i use slave program also not ...
CKocar's user avatar
  • 566
0 votes
3 answers
1k views

I have a small script that will check to see if a list of devices are either ssh or telnet enable. Here is my code: import socket import sys file = open('list', 'r') file = file.readlines() list = []...
amb1s1's user avatar
  • 2,085
1 vote
1 answer
434 views

I have this problem with a portscanner which keeps hanging at scanning port 1. How can I solve this problem? #! /usr/bin/env python import socket import subprocess from datetime ...
0 votes
0 answers
153 views

I'm working with sockets and noticed my program gets 'stuck' sometimes when I'm trying to perform a socket.close(). Is it possible to set a timeout for how long socket.close() is allowed to take ...
tyleax's user avatar
  • 1,850
0 votes
1 answer
105 views

I'm having trouble with my code here, when I input a port range when it comes to a closed port the program will just pause. Its fine when it has open ports. Can anyone help? #!/usr/bin/env python ...
MrTurvey's user avatar
2 votes
1 answer
138 views

I have the following piece of code in Java: RequestConfig.custom().setSocketTimeout(10).setConnectTimeout(20).build(); How do I achieve the same thing in Python?
user avatar
0 votes
0 answers
52 views

I want to check if Google is reachable or not. I'm using this code: import socket def google_is_reachable(): try: sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM) ...