Created
April 10, 2015 17:18
-
-
Save Averroes/e5ed6ed065e8d2f0b00d to your computer and use it in GitHub Desktop.
passing a socket file descriptor between processes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from socket import socket, AF_INET, SOCK_STREAM | |
| s = socket(AF_INET, SOCK_STREAM) | |
| s.connect(('localhost', 15000)) | |
| s.send(b'Hello\n') | |
| print('Got:', s.recv(8192)) | |
| s.send(b'World\n') | |
| print('Got:', s.recv(8192)) | |
| s.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment