Created
April 8, 2010 05:51
-
-
Save zpoley/359819 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/python | |
from socket import * | |
import time | |
import subprocess | |
SERVER = "localhost" | |
PORT = 27072 | |
# start udps UDP server | |
p = subprocess.Popen(["./udps"]) | |
# give the udps server 1 second to ready | |
time.sleep(1) | |
s = socket(AF_INET, SOCK_DGRAM) | |
s.sendto("test 1", (SERVER, PORT)) | |
print "udps.log contents:\n" | |
subprocess.call(["cat", "udps.log"]) | |
print "\nkill ./udps udp server" | |
subprocess.Popen.kill(p) | |
print "\ndelete udps log test" | |
subprocess.call(["rm", "udps.log"]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment