Commit 7f26634f authored by Barry Warsaw's avatar Barry Warsaw

Added an os._exit(0) in the parent so we don't have two test processes

after test_socket.py is run!
parent 355623f5
...@@ -86,6 +86,7 @@ except socket.error: ...@@ -86,6 +86,7 @@ except socket.error:
try: try:
PORT = 50007 PORT = 50007
if os.fork(): if os.fork():
# parent is server
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(hostname, PORT) s.bind(hostname, PORT)
s.listen(1) s.listen(1)
...@@ -115,7 +116,9 @@ try: ...@@ -115,7 +116,9 @@ try:
print 'received:', data print 'received:', data
conn.send(data) conn.send(data)
conn.close() conn.close()
os._exit(0)
else: else:
# child is client
time.sleep(1) time.sleep(1)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
if verbose: if verbose:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment