Skip to content

Instantly share code, notes, and snippets.

@snyh
Created December 15, 2013 10:48
Show Gist options
  • Save snyh/7971483 to your computer and use it in GitHub Desktop.
Save snyh/7971483 to your computer and use it in GitHub Desktop.
import socket
s = socket.socket(socket.AF_UNIX)
addr = "\0org.snyh.test"
s.bind(addr)
while(True):
pass
# use netstat -anp | grep snyh
# to verify it
@snyh
Copy link
Author

snyh commented Dec 15, 2013

The firs character of address must be '\0'.

Thanks python doesn't use '\0' for string terminal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment