From: Joel Reymont <joelr1@gmail.com>
To: caml-list <caml-list@inria.fr>
Subject: [Caml-list] ocamlnet, netclient and closing connection after every http client request
Date: Sat, 11 Jun 2011 18:11:29 +0400 [thread overview]
Message-ID: <12E34CD6-9D7D-4BA3-9576-57DC25AB94FC@gmail.com> (raw)
I'm using netclient from ocamlnet 3.2.1 to issue thousands of http requests.
This leaves me with thousands of sockets hanging around open, until I run out of sockets.
Is there a way to tell netclient that I want a single connection open to my server at any given time, no more?
I tried copying Http_client.Convenience to add the following settings but this didn't solve my problem.
let http_realistic =
serialize
(fun () ->
let p = Lazy.force pipe in
let opt = p # get_options in
p # set_options
{ opt with
synchronization = Sync;
connection_timeout = 30.0; (* seconds *)
number_of_parallel_connections = 1;
inhibit_persistency = true;
};
)
What am I doing wrong?
Thanks, Joel
--------------------------------------------------------------------------
- for hire: mac osx device driver ninja, kernel extensions and usb drivers
---------------------+------------+---------------------------------------
http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
---------------------+------------+---------------------------------------
next reply other threads:[~2011-06-11 14:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-11 14:11 Joel Reymont [this message]
2011-06-12 10:56 ` Gerd Stolpmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=12E34CD6-9D7D-4BA3-9576-57DC25AB94FC@gmail.com \
--to=joelr1@gmail.com \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox