Created
July 10, 2017 09:11
-
-
Save salihkaragoz/86e9152d3382698945dc6949fd2c161b to your computer and use it in GitHub Desktop.
UDPClient Close time for Unreachable Ip with Pyhton
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import time | |
import datetime | |
IPADDR = '192.168.1.141' | |
PORTNUM = 5600 | |
PACKETDATA = "f1a525da11f6".encode() | |
while(True): | |
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 0) | |
s.connect((IPADDR, PORTNUM)) | |
s.send(PACKETDATA) | |
time.sleep(1) | |
print(datetime.datetime.now()) | |
s.close() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment