From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p5CAugDC002902 for ; Sun, 12 Jun 2011 12:56:42 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqQBAOCa9E3U4xEKkWdsb2JhbABShEmiBRQBAQEBCQsLBxQDIohysRiPWIErg2+BCgSKfYsGixA X-IronPort-AV: E=Sophos;i="4.65,354,1304287200"; d="scan'208";a="96629219" Received: from moutng.kundenserver.de ([212.227.17.10]) by mail2-smtp-roc.national.inria.fr with ESMTP; 12 Jun 2011 12:56:37 +0200 Received: from office1.lan.sumadev.de (dslb-094-219-219-078.pools.arcor-ip.net [94.219.219.78]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0M96Lt-1QOJoX1q5l-00DApv; Sun, 12 Jun 2011 12:56:36 +0200 Received: from [192.168.0.33] (dslb-084-058-010-063.pools.arcor-ip.net [84.58.10.63]) by office1.lan.sumadev.de (Postfix) with ESMTPSA id EE9D85F701; Sun, 12 Jun 2011 12:56:35 +0200 (CEST) From: Gerd Stolpmann To: Joel Reymont Cc: caml-list In-Reply-To: <12E34CD6-9D7D-4BA3-9576-57DC25AB94FC@gmail.com> References: <12E34CD6-9D7D-4BA3-9576-57DC25AB94FC@gmail.com> Content-Type: text/plain; charset="UTF-8" Date: Sun, 12 Jun 2011 12:56:57 +0200 Message-ID: <1307876217.16462.14.camel@gps-desktop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:EwT+ffvYoobsCRX4cAIJg8dCDsYc/fHV6zb90UP5Rxd 4SfH5szy9o3pUgKUdHhFm6vsUeI0n9nwIK5C8Ri9y128sgqxS0 PUgTes2I5/Az5prVUmyT67+f1W44BodW9aUCOK5stHiz6S+uLq krgEdzgO2nzCmXzTE7hd3U+t6QcDJvUMgOiQMXgaP7HRKzt3Oo G/YuV9UAZZ8b5QTFfvSrQ== Subject: Re: [Caml-list] ocamlnet, netclient and closing connection after every http client request Am Samstag, den 11.06.2011, 18:11 +0400 schrieb Joel Reymont: > 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. This should not happen - the expected behavior is that the connection is closed. > Is there a way to tell netclient that I want a single connection open to my server at any given time, no more? That should be controlled by number_of_parallel_connections. > 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? No idea. Do you have a sample program demonstrating the effect? Also, in ocamlnet-3.3.1 (released on Friday) large parts of the Http_client were rewritten. Maybe your bug goes away by simply upgrading. Gerd > > Thanks, Joel > > -------------------------------------------------------------------------- > - for hire: mac osx device driver ninja, kernel extensions and usb drivers > ---------------------+------------+--------------------------------------- > http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont > ---------------------+------------+--------------------------------------- > > > > >