<div dir="ltr">Chandru,<br><br>Thanks, that absolutely did the trick! I used the first version; that's all I need.<br><br>Regards,<br>Edwin<br><br><div class="gmail_quote">On Tue, Aug 5, 2008 at 10:30 AM, Chandru <span dir="ltr"><<a href="mailto:chandrashekhar.mullaparthi@gmail.com">chandrashekhar.mullaparthi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div dir="ltr">Hi Edwin,<br><br>ibrowse by default tries to open a new connection if it is within the limit of the number of connections it is allowed. By default it is 10. It starts pipelining only after all connections in that pool are busy.<br>

<br>If you want to use the same connection, there are two ways, set the max_sessions parameter in your request to 1. For example:<br><br>ibrowse:send_req("<a href="http://localhost:7796/cgi-bin/erl/ebdc_web/country" target="_blank">http://localhost:7796/cgi-bin/erl/ebdc_web/country</a>", [], post, [], [{max_sessions, 1}]).<br>

<br>Or, you can do the following.<br><br>{ok, Pid} = ibrowse:spawn_worker_process("localhost", 7796).     <br>ibrowse:send_req_direct(Pid, "<a href="http://localhost:7796/cgi-bin/erl/ebdc_web/country" target="_blank">http://localhost:7796/cgi-bin/erl/ebdc_web/country</a>", [], post, [], []).<br>

<br>The first option is if you don't care which connection it goes over. The second version is if you want fine grained control on which requests go on which connection. I hope this helps.<br><br>cheers<br><font color="#888888">Chandru</font><div class="Ih2E3d">
<br>
<br><div class="gmail_quote">2008/8/4 Edwin Fine <span dir="ltr"><<a href="mailto:erlang-questions_efine@usa.net" target="_blank">erlang-questions_efine@usa.net</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div dir="ltr">Hi Chandru,<br><br>Thanks for the tip. I am in fact aware of ibrowse. I tried a version of it from Jungerl and it seemed to be doing the same thing. Maybe I have an old version (1.4) or I am not setting something up correctly. To duplicate this behavior, simply repeat the same ibrowse:send from the Erlang shell a few times, while watching the TCP traffic with Ethereal or similar. What I saw is different local ports being used each time even though posting to the same URL each time. I want the same port (i.e. connection) to be kept open and reused to avoid the connect/disconnect overhead. If there's a way to circumvent this, I'd like to know how, please.<br>


<br>Regards,<br><font color="#888888">Edwin</font><div><div></div><div><br><br><div class="gmail_quote">On Mon, Aug 4, 2008 at 12:51 PM, Chandru <span dir="ltr"><<a href="mailto:chandrashekhar.mullaparthi@gmail.com" target="_blank">chandrashekhar.mullaparthi@gmail.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div dir="ltr">Hi Edwin,<br><br><div class="gmail_quote">2008/8/4 Edwin Fine <span dir="ltr"><<a href="mailto:erlang-questions_efine@usa.net" target="_blank">erlang-questions_efine@usa.net</a>></span><div>


<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr">Thanks, Ingela, I look forward to seeing the modifications. Hopefully you can post a patch so I don't have to wait for the next Erlang release.<br><br>Regards,<br><font color="#888888">Edwin</font></div>



</blockquote></div><div><br>In case you didn't know, there is an alternative HTTP client called ibrowse. which has a very similar API. You can use that while you wait for a fix. I believe it doesn't impose any such restriction.<br>



<br>cheers<br><font color="#888888">Chandru<br></font><br></div></div>PS: I am the author!</div>
</blockquote></div><br><br clear="all"><br></div></div><div>-- <br>For every expert there is an equal and opposite expert - Arthur C. Clarke<br>
</div></div>
</blockquote></div><br></div></div>
</blockquote></div><br><br clear="all"><br>-- <br>For every expert there is an equal and opposite expert - Arthur C. Clarke<br>
</div>