Add simple Unix socket example by Piet van Oostrum.

This commit is contained in:
Guido van Rossum 1998-01-28 16:54:00 +00:00
parent 5b8b8cd6c0
commit dd918a990a
3 changed files with 27 additions and 1 deletions

View file

@ -0,0 +1,10 @@
# Echo client demo using Unix sockets
# Piet van Oostrum
from socket import *
FILE = 'blabla'
s = socket(AF_UNIX, SOCK_STREAM)
s.connect(FILE)
s.send('Hello, world')
data = s.recv(1024)
s.close()
print 'Received', `data`