Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default TCP options #4

Open
useronym opened this issue Apr 7, 2015 · 0 comments
Open

Default TCP options #4

useronym opened this issue Apr 7, 2015 · 0 comments

Comments

@useronym
Copy link
Contributor

useronym commented Apr 7, 2015

I think some of the default options passed onto the TCP Socket should be removed. The reason is that you can't overwrite them, you can only append to them.

Currently, the options (in include/gen_tcp_server.hrl) are:

[binary, {packet, raw}, {active, once}, {reuseaddr, true}]

For example, if you start a gen_tcp_server like this:

gen_tcp_server:start_link(?MODULE, ?PORT, [{packet, line}]).

Your option requesting to receive the packet line by line will be most likely ignored. I would suggest removing at least the {packet, raw} option; perhaps the binary option should stay, as it is most likely used by everyone anyway :) Still, it might be a good idea to remove it as well, just in case it confuses someone who's trying to receive lists (what would even happen if you started a TCP socket with both list and binary options at the same time?)

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

No branches or pull requests

1 participant