Skip to content

Commit

Permalink
Add Transport:setopts/2 note for writing protocols
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc Hoguin committed Aug 11, 2011
1 parent 43d14b5 commit cd06efe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ After initializing your protocol, it is recommended to wait to receive a message
containing the atom 'shoot', as it will ensure Cowboy has been able to fully
initialize the socket. Anything you do past this point is up to you!

If you need to change some socket options, like enabling raw mode for example,
you can call the <em>Transport:setopts/2</em> function. It is the protocol's
responsability to manage the socket usage, there should be no need for an user
to specify that kind of options while starting a listener.

You should definitely look at the cowboy_http_protocol module for a great
example of fast request handling if you need to. Otherwise it's probably
safe to use `{active, once}` mode and handle everything as it comes.
Expand Down

0 comments on commit cd06efe

Please sign in to comment.