caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] ocamlnet, netclient and closing connection after every http client request
@ 2011-06-11 14:11 Joel Reymont
  2011-06-12 10:56 ` Gerd Stolpmann
  0 siblings, 1 reply; 2+ messages in thread
From: Joel Reymont @ 2011-06-11 14:11 UTC (permalink / raw)
  To: caml-list

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
---------------------+------------+---------------------------------------





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-12 10:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-11 14:11 [Caml-list] ocamlnet, netclient and closing connection after every http client request Joel Reymont
2011-06-12 10:56 ` Gerd Stolpmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).