Gitiles
Code Review
Sign In
gerrit-public.fairphone.software
/
platform
/
external
/
python
/
cpython3
/
a8c360ee76fb76902a2e2140fbb38d4b06b2d9fb
/
.
/
Demo
/
sockets
/
unixclient.py
blob: fdbcc7aec1e95320f88953e75016fc4a2b4b00f4 [
file
] [
log
] [
blame
]
# Echo client demo using Unix sockets
# Piet van Oostrum
from
socket
import
*
FILE
=
'unix-socket'
s
=
socket
(
AF_UNIX
,
SOCK_STREAM
)
s
.
connect
(
FILE
)
s
.
send
(
'Hello, world'
)
data
=
s
.
recv
(
1024
)
s
.
close
()
print
'Received'
,
repr
(
data
)