<html><head></head><body><div>What's the reason for changing the option in the first place? Why not to stick to {packet,0}?<br /><div class="acompli_signature"><br />Sent from <a href="http://taps.io/outlookmobile">Outlook</a></div><br /></div><br /><br /><br />
<div class="gmail_quote">On Wed, Mar 4, 2015 at 6:40 AM -0800, "Pedro Marques da Silva" <span dir="ltr"><<a href="mailto:posilva@gmail.com" target="_blank">posilva@gmail.com</a>></span> wrote:<br />
<br />
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="3D"ltr"">
<div dir="ltr">Hi, <div><br /></div><div>I have looked before I post the question and is not clear why this will happen.</div><div><br /></div><div>Maybe is not possible to switch from {packet,0} to {packet,4} after receiving data on a socket!</div><div><br /></div><div>Best</div><div><br /></div><div>pms</div><div><br /></div><div><br /></div><div><br /></div></div><div class="gmail_extra"><br clear="all" /><div><div class="gmail_signature">--<br />Pedro Marques da Silva<br />---------------------------------------------------<br />E-mail Pessoal : <a href="mailto:posilva@gmail.com" target="_blank">posilva@gmail.com</a><br />---------------------------------------------------</div></div>
<br /><div class="gmail_quote">2015-03-04 11:25 GMT+00:00 Rad Gruchalski <span dir="ltr"><<a href="mailto:radek@gruchalski.com" target="_blank">radek@gruchalski.com</a>></span>:<br /><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
Hi Pedro,</div><div><br /></div><div>You should have a look at inet:setopts</div><div><a href="http://www.erlang.org/doc/man/inet.html#setopts-2" target="_blank">http://www.erlang.org/doc/man/inet.html#setopts-2</a></div><div>
<p style="font-family:Helvetica;font-size:10pt;margin-bottom:0cm">
</p><p style="font-family:Helvetica;font-size:10pt;margin-bottom:0cm">
</p><p style="margin-bottom:0cm">
</p><p style="margin-bottom:0cm"><font color="#000000"><font face="Helvetica, sans-serif"><font style="font-size:9pt">Kind
regards,
<br />Radek
Gruchalski<br />
</font></font></font><font face="Helvetica, sans-serif"><font style="font-size:9pt"><a href="mailto:radek@gruchalski.com" target="_blank">radek@gruchalski.com</a><a href="mailto:radek@gruchalski.com" target="_blank">
</a></font></font><font color="#0084d1"><font face="Helvetica, sans-serif"><font style="font-size:9pt"><br /></font></font></font><a href="http://de.linkedin.com/in/radgruchalski/" target="_blank"><font color="#0084d1"><font face="Helvetica, sans-serif"><font style="font-size:9pt">de.linkedin.com/in/radgruchalski/</font></font></font></a><font color="#000000"><font face="Helvetica, sans-serif"><font style="font-size:9pt"><br /><br /></font></font></font><font color="#878787"><font face="Helvetica, sans-serif"><font style="font-size:8pt"><b>Confidentiality:<br /></b></font></font></font><font color="#878787"><font face="Helvetica, sans-serif"><font style="font-size:8pt">This
communication is intended for the above-named person and may be
confidential and/or legally privileged.<br />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
immediately.</font></font></font></p></div><div><div class="h5">
<p style="color:#a0a0a8">On Wednesday, 4 March 2015 at 01:48, Pedro Marques da Silva wrote:</p>
</div></div><blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px">
<span><div><div><div class="h5"><div><div dir="ltr">Hi Erlangers,<div><br /></div><div>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.</div><div><br /></div><div><br /></div><div>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</div><div><br /></div><div><br /></div><div>Any one knows about any problem with changing socket options after receive some data?</div><div><br /></div><div>thanks<br clear="all" /><div><div>--<br />Pedro Marques da Silva<br />---------------------------------------------------<br />E-mail Pessoal : <a href="mailto:posilva@gmail.com" target="_blank">posilva@gmail.com</a><br />---------------------------------------------------</div></div>
</div></div>
</div></div></div><div><div>_______________________________________________</div><div>erlang-questions mailing list</div><div><a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a></div><div><a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a></div></div></div></span>
</blockquote>
<div>
<br />
</div>
</blockquote></div><br /></div>
</div>
</blockquote>
</div>
</body></html>