diff options
author | Sanjit Bhat <[email protected]> | 2023-10-26 06:44:48 -0400 |
---|---|---|
committer | Sanjit Bhat <[email protected]> | 2023-10-26 06:44:48 -0400 |
commit | cfae93475dfb4cb5cfe264f4c029136e1447c262 (patch) | |
tree | 699903e093e3a23caf7ce3899e7c80e48511f900 /ping.py | |
parent | 1ed40716eb54e371df9d1814b9129666b3fe4f09 (diff) | |
download | xv6-labs-cfae93475dfb4cb5cfe264f4c029136e1447c262.tar.gz xv6-labs-cfae93475dfb4cb5cfe264f4c029136e1447c262.tar.bz2 xv6-labs-cfae93475dfb4cb5cfe264f4c029136e1447c262.zip |
net add missing files
Diffstat (limited to 'ping.py')
-rw-r--r-- | ping.py | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -0,0 +1,12 @@ +import socket +import sys +import time + +sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) +addr = ('localhost', int(sys.argv[1])) +buf = "this is a ping!".encode('utf-8') + +while True: + print("pinging...", file=sys.stderr) + sock.sendto(buf, ("127.0.0.1", int(sys.argv[1]))) + time.sleep(1) |