I added a simple semaphore to limit number of concurrent connections to 10 + 10 queued connection due to listen(). It may need some tuning or possibility to change with some command-line parameters perhaps. A read-timeout could perhaps also be added to avoid users to do multiple "telnet owserver 4304" and only lock the slots without using them. If there are no command-bytes read for 1 second after the accept() or something similar, it would be best for owserver to automatically close the connection and free it for other users.
This will protect owserver from being flooded with too many requests. Is this ok for you all? /Christian -----Original Message----- From: Christian Magnusson [mailto:m...@mag.cx] Sent: den 10 juni 2009 19:36 To: owfs-developers@lists.sourceforge.net Subject: Re: [Owfs-developers] Two owserver problems Right now we seldom have more than 1 connecting request in the listen-queue at a time... mostly since the code _very_ quickly accepts all connections and removes them from the queue. I'm sure nobody would notice any difference if the listen-queue was lowered from 10 to 1 in the current source. Adding that semaphore which limits the total number of concurrent connections + allowing 10 in queue, would fix most problems I guess. /Christian -----Original Message----- From: Paul Alfille [mailto:paul.alfi...@gmail.com] Sent: den 10 juni 2009 12:50 To: owfs-developers@lists.sourceforge.net Subject: Re: [Owfs-developers] Two owserver problems On Wed, Jun 10, 2009 at 2:37 AM, Christian Magnusson<m...@mag.cx> wrote: > > Listen() in ow_net_server.c handles #1 automatically, more or less... It's > set to handle 10 requests today, and according to the man-pages you see > this: > "If a connection request arrives when the queue is full, the client may > receive an error with an indication of ECONNREFUSED or, if the underlying > protocol supports retransmission, the request may be ignored so that a > later reattempt at connection succeeds." Now that you mention it, this does sound familiar. Perhaps I'm misinterpreting my test results. Back to the analysis... Paul ---------------------------------------------------------------------------- -- Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers ---------------------------------------------------------------------------- -- Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers ------------------------------------------------------------------------------ _______________________________________________ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers