Answer the question
In order to leave comments, you need to log in
Is there a timeout on a Python socket?
There is a function that uses the Socket class to send and receive an array of bytes.
def CheckServer(IP,Port):
try:
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
for i in range (5):
sock.sendto(smertlogin, (IP, Port))
data = sock.recv(1024)
ndata = str(data)
if "fe" in ndata and "fd" in ndata:
print(color_green + "[+] " + IP + ":" + str(Port) + " Is 2.2.5 SERVER !" + reset)
else:
print(color_r + "[-] " + IP + ":" + str(Port) + " this is not 2.2.5 Server" + reset)
except:
print(color_r + "[-] " + IP + ":" + str(Port) + " this is not 2.2.5 Server" + reset)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question