Skip to content

Commit

Permalink
Merge pull request #61 from patricklucas/clarify_abstract_socket
Browse files Browse the repository at this point in the history
Add clarification for abstract sockets
  • Loading branch information
jonashaag committed Feb 28, 2012
2 parents 0c9e508 + 989b7d7 commit 4d41383
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.rst
Expand Up @@ -61,6 +61,9 @@ Usage
# Bind to Unix socket: # Bind to Unix socket:
bjoern.run(wsgi_application, 'unix:/path/to/socket') bjoern.run(wsgi_application, 'unix:/path/to/socket')


# Bind to abstract Unix socket: (Linux only)
bjoern.run(wsgi_application, 'unix:@socket_name')

Alternatively, the mainloop can be run separately:: Alternatively, the mainloop can be run separately::


bjoern.listen(wsgi_application, host, port) bjoern.listen(wsgi_application, host, port)
Expand Down
2 changes: 1 addition & 1 deletion bjoern/server.c
Expand Up @@ -89,7 +89,7 @@ bool server_init(const char* hostaddr, const int port)
sockaddr.sun_family = PF_UNIX; sockaddr.sun_family = PF_UNIX;
strcpy(sockaddr.sun_path, hostaddr); strcpy(sockaddr.sun_path, hostaddr);


/* Use @ for abstract */ /* Use @ for abstract (Linux) */
if(hostaddr[0] == '@') if(hostaddr[0] == '@')
sockaddr.sun_path[0] = '\0'; sockaddr.sun_path[0] = '\0';
else else
Expand Down

0 comments on commit 4d41383

Please sign in to comment.