Skip to content

Conversation

RyanSquared
Copy link
Contributor

Review (http://stackoverflow.com/questions/15716302/so-reuseaddr-and-af-unix) on whether SO_REUSEADDR should be kept?

@daurnimator
Copy link
Owner

  • cs.listen should only be called in a single location.
  • might as well pass all the arguments (i.e. v6only and reuseport) that the user passes in. If they use a path and reuseport that's their problem. There won't be any problems if you pass in host,port and path all in the one constructor.
  • I'd prefer you didn't use the host variable to store a path, it's just confusing.
  • You need to write tests
  • Need to update docs

@daurnimator
Copy link
Owner

Furthermore, if you're allowing binding unix sockets, you should probably add support for the cs.listen options:

  • .mode string:nil fchmod or chmod socket after creating UNIX domain socket
  • .mask string:nil set and restore umask when binding UNIX domain sockets
  • .unlink boolean:false unlink socket path before binding

http/server.lua Outdated
assert(host or path, "need host or path")
local port = tbl.port
if port == nil then
if port == nil and tbl.host then
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just use host instead of indexing again.

@daurnimator
Copy link
Owner

Blocked on #9

@daurnimator
Copy link
Owner

#9 was resolved.

Are you able to resolve my other comments?

@daurnimator daurnimator changed the title Optionally use path instead of host/port combination Option to have http.server listen on a unix socket instead of TCP Feb 17, 2016
stream:get_headers()
stream:shutdown()
s:shutdown()
print 'shutting down server // spy'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove these prints.

@RyanSquared
Copy link
Contributor Author

Closing for reformatting commits, will create a new PR later.

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

Successfully merging this pull request may close these issues.

2 participants