source:
python/trunk/Demo/sockets/unixclient.py@
1538
| Last change on this file since 1538 was 2, checked in by , 15 years ago | |
|---|---|
|
|
| File size: 232 bytes | |
| Line | |
|---|---|
| 1 | # Echo client demo using Unix sockets |
| 2 | # Piet van Oostrum |
| 3 | |
| 4 | from socket import * |
| 5 | |
| 6 | FILE = 'unix-socket' |
| 7 | s = socket(AF_UNIX, SOCK_STREAM) |
| 8 | s.connect(FILE) |
| 9 | s.send('Hello, world') |
| 10 | data = s.recv(1024) |
| 11 | s.close() |
| 12 | print 'Received', repr(data) |
Note:
See TracBrowser
for help on using the repository browser.
