mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
To be a good citizen, it should really delete its socket when done.
This commit is contained in:
parent
cb3988c48b
commit
9463792c68
1 changed files with 2 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
||||||
# Echo server demo using Unix sockets (handles one connection only)
|
# Echo server demo using Unix sockets (handles one connection only)
|
||||||
# Piet van Oostrum
|
# Piet van Oostrum
|
||||||
|
import os
|
||||||
from socket import *
|
from socket import *
|
||||||
FILE = 'blabla'
|
FILE = 'blabla'
|
||||||
s = socket(AF_UNIX, SOCK_STREAM)
|
s = socket(AF_UNIX, SOCK_STREAM)
|
||||||
|
@ -13,3 +14,4 @@ while 1:
|
||||||
if not data: break
|
if not data: break
|
||||||
conn.send(data)
|
conn.send(data)
|
||||||
conn.close()
|
conn.close()
|
||||||
|
os.unlink(FILE)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue