Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9463792

Browse files
author
Skip Montanaro
committed
To be a good citizen, it should really delete its socket when done.
1 parent cb3988c commit 9463792

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Demo/sockets/unixserver.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Echo server demo using Unix sockets (handles one connection only)
22
# Piet van Oostrum
3+
import os
34
from socket import *
45
FILE = 'blabla'
56
s = socket(AF_UNIX, SOCK_STREAM)
@@ -13,3 +14,4 @@
1314
if not data: break
1415
conn.send(data)
1516
conn.close()
17+
os.unlink(FILE)

0 commit comments

Comments
 (0)