Does it have to be the same port?  You could use gen_tcp to listen to connections on a different port and handle the traffic however you would like.<div><br><div class="gmail_quote">On Tue, Aug 16, 2011 at 2:40 PM, ori brost <span dir="ltr"><<a href="mailto:oribrost@gmail.com">oribrost@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I am using mochiweb for a server that may also get a TCP connction to<br>
which the client sends a simple string (without a newline, the string<br>
is not http). Mochiweb uses HTTP sockets and therefore fails to detect<br>
this (i dont even get http_error that i can easily get in mochiweb).<br>
How can I solve this? Ideally I wish to change mochiweb code to do<br>
setopt({packet, http_or_raw}) but this kind of thing does not exist.<br>
How would you recommend handling this? my current idea was to modify<br>
mochiweb and use erlang:decode_packet, is there a better approach?<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div><br></div>