msantos / procket

Erlang interface to low level socket operations
http://blog.listincomprehension.com/search/label/procket
BSD 3-Clause "New" or "Revised" License
283 stars 80 forks source link

procket:progname/0 fix #5

Closed RGafiyatullin closed 12 years ago

RGafiyatullin commented 12 years ago

procket did not work when used as ez-application. Reason: procket:progname/0 expected procket.erl is always unzipped. In my case it was not.

Best regards.

msantos commented 12 years ago

Hey Roman! Thanks! I've never tried setting up an ez before, so this is great.

If I try procket:progname/0 with your patch just from the REPL, I get an exception because code:priv(procket) returns {error, bad_name}. I guess the old code should be used in that case. What do you think?

RGafiyatullin commented 12 years ago

I assume having an app-env configuration property falling back to the priv-dir makes sence. On production several nodes/releases might need to share the same binary. Having it shared will let having a single line in sudoers file.

msantos commented 12 years ago

It's an interesting idea. It will still fail in the "simple" case though where someone fires up an Erlang shell:

$ erl -pa ebin
1> {ok, FD} = procket:open(53, [{protocol, udp},{type, dgram},{family, inet}]).
msantos commented 12 years ago

Merged, thanks!