Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.011 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'json': 0.07; 'socket': 0.07; 'mail:': 0.09; 'pages.': 0.09; 'subject:How': 0.10; 'cc:addr :python-list': 0.11; 'python': 0.11; 'formatted': 0.16; 'improper': 0.16; 'sockets': 0.16; 'subject:non': 0.16; 'prevent': 0.16; 'subject: ?': 0.16; 'wrote:': 0.18; 'discussion': 0.18; 'seems': 0.21; 'cc:addr:python.org': 0.22; 'certainly': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'script': 0.25; '>': 0.26; 'second': 0.26; 'post': 0.26; 'header:In-Reply- To:1': 0.27; 'external': 0.29; '[1]': 0.29; '[2]': 0.30; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'url:mailman': 0.30; 'url:python': 0.33; 'maybe': 0.34; 'problem': 0.35; 'something': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'done': 0.36; 'url:listinfo': 0.36; 'doing': 0.36; "didn't": 0.36; 'thanks': 0.36; 'url:org': 0.36; 'url:library': 0.38; 'enough': 0.39; 'url:mail': 0.40; 'most': 0.60; 'full': 0.61; 'browser': 0.61; 'email addr:gmail.com': 0.63; 'taking': 0.65; '2015': 0.84; 'grabbing': 0.84; 'subject:skip:S 20': 0.91; 'skip:y 40': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=72WFiuAvpJEozvxnJHljRRDfbUyFScPaCSxsJaefM9c=; b=HLb8SxEUWNz4/xiooJQm/eAHMiVg63ejWO2IeKus+I439At/e4qZyySkx7SHgI343T ZhJacu7Fn3HDzeUR0y2hsQUWU/NnuHIZ3vjCkvFtB5JuJ0UJVhqSaJgSG6onGLxeVuVp CxXWJ4X+7L/m8cr/auspfz2x92txUZ3TfMcTnmhRdfyfRh2svB/4vM/o7gQu5h3add6d P6nT/ehhEKNQoaRbdsniJ+6I+tsX6Ofup3nHbqk1uylmuOPCxtm/8ABFC5efhNiAjbMp S5eNhkhXvRGb0HpQ8R22WuuPnd4oN4I7kp3uSpAwijIM518Hv56q7V85QKd7RLe120EY 9Kmw== MIME-Version: 1.0 X-Received: by 10.112.67.41 with SMTP id k9mr25124568lbt.35.1422975827554; Tue, 03 Feb 2015 07:03:47 -0800 (PST) In-Reply-To: <3b558129-df61-4a3d-9cca-17e5340c33a3@googlegroups.com> References: <47031e69-e94d-4257-8c7d-e7c00a543634@googlegroups.com> <874mr3ibve.fsf@elektro.pacujo.net> <87r3u7grd3.fsf@elektro.pacujo.net> <3b558129-df61-4a3d-9cca-17e5340c33a3@googlegroups.com> Date: Tue, 3 Feb 2015 16:03:47 +0100 Subject: Re: How to write a non blocking SimpleHTTPRequestHandler ? From: Filadelfo Fiamma To: Yassine Chaouche Content-Type: multipart/alternative; boundary=001a11349cb4b9b4a3050e3060df Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 84 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1422975829 news.xs4all.nl 2832 [2001:888:2000:d::a6]:35941 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:85156 --001a11349cb4b9b4a3050e3060df Content-Type: text/plain; charset=UTF-8 I think You can try the asyncore lib: https://docs.python.org/2/library/asyncore.html 2015-02-03 15:50 GMT+01:00 Yassine Chaouche < yacinechaouche@yahoo.com.dmarc.invalid>: > On Tuesday, February 3, 2015 at 3:17:37 PM UTC+1, Amirouche Boubekki wrote: > > What you want is to prevent the socket to wait indefinetly for data > (based on strace output) which is done with socket.setblocking/settimeout > [1] > > Exactly ! thanks for taking time to reading my original post a second > time. Maybe I didn't express my problem well enough and the discussion has > maybe drifted to an XYProblem type discussion :) > > I was about to say that most webframeworks for python already take care of > the problem I'm facing, so I certainly confused people with improper > formulation. > > > There is contentbrowser [2] which is somekind of web proxy. > > It's using werkzeug and it seems to be a full web application. I just want > something that is right above sockets and selects. All that my script is > doing is grabbing some json data from an external url provided by the > browser and return a formatted page showing the json data in human-readable > HTML pages. Nothing fancy. > > -- > https://mail.python.org/mailman/listinfo/python-list > -- Filadelfo Fiamma mail: philosganga@gmail.com --001a11349cb4b9b4a3050e3060df Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I think You can try the asyncore lib: https://docs.python.org/2/libr= ary/asyncore.html


2015-02-03 15:50 GMT+01:00 Yassine Chaouche <yacinechaouche@yahoo.com.dmarc.invalid>:
<= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex">On Tuesday, February 3, 2015 at 3:17:37 PM UT= C+1, Amirouche Boubekki wrote:
> What you want is to prevent the socket to wait indefinetly for data (b= ased on strace output) which is done with socket.setblocking/settimeout [1]=

Exactly ! thanks for taking time to reading my original post a second time.= Maybe I didn't express my problem well enough and the discussion has m= aybe drifted to an XYProblem type discussion :)

I was about to say that most webframeworks for python already take care of = the problem I'm facing, so I certainly confused people with improper fo= rmulation.

> There is contentbrowser [2] which is somekind of web proxy.

It's using werkzeug and it seems to be a full web application. I just w= ant something that is right above sockets and selects. All that my script i= s doing is grabbing some json data from an external url provided by the bro= wser and return a formatted page showing the json data in human-readable HT= ML pages. Nothing fancy.

--
https://mail.python.org/mailman/listinfo/python-list



--
Filadelfo Fiamma
=
=C2=A0
--001a11349cb4b9b4a3050e3060df--