[erlang-questions] inet setoptions after receive data

Radoslaw Gruchalski radek@REDACTED
Wed Mar 4 15:44:39 CET 2015

What's the reason for changing the option in the first place? Why not to stick to {packet,0}?

Sent from Outlook

On Wed, Mar 4, 2015 at 6:40 AM -0800, "Pedro Marques da Silva" <posilva@REDACTED> wrote:

I have looked before I post the question and is not clear why this will happen.
Maybe is not possible to switch from {packet,0} to {packet,4} after receiving data on a socket!

Pedro Marques da Silva
E-mail Pessoal : posilva@REDACTED

2015-03-04 11:25 GMT+00:00 Rad Gruchalski <radek@REDACTED>:

                    Hi Pedro,
You should have a look at inet:setoptshttp://www.erlang.org/doc/man/inet.html#setopts-2








communication is intended for the above-named person and may be
confidential and/or legally privileged.
If it has come to you in
error you must take no action based on it, nor must you copy or show
it to anyone; please delete/destroy and inform the sender

On Wednesday, 4 March 2015 at 01:48, Pedro Marques da Silva wrote:
                    Hi Erlangers,
I am doing a server to serve a flash application. When a flash client establish a connection(tcp socket) it sends a policy request (xml format message) and the server must reply with a policy file (xml file). After this exchange the client can connect to the socket as a regular connection.

When I accept the connection the socket have a {packet,0} option set and checks if is a policy request and sends the policy file back. After this I change the option to {packet,4} but I do not receive anymore data. If I stay with {packet,0} I will receive the binary data sent by the client

Any one knows about any problem with changing socket options after receive some data?
Pedro Marques da Silva
E-mail Pessoal : posilva@REDACTED

_______________________________________________erlang-questions mailing listerlang-questions@REDACTED://erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150304/2f120343/attachment.htm>

More information about the erlang-questions mailing list