On Wed, Apr 15, 2009 at 3:41 AM, Marius Gedminas <[email protected]> wrote:
> On Tue, Apr 14, 2009 at 10:22:08AM +0200, Eric Lemoine wrote:
>> I want to use
>>
>> [server:main]
>> use = egg:Paste#http
>> host = 0.0.0.0
>> port = 0
>>
>> so that my Pylons app's port number is assigned for me.
>>
>> Now, from my app's make_app() function do I have a way to know what
>> port number has actually been assigned?
>
> I don't think so:
>
>  * the server is not necessarily created/configured when the
>    environment calls your make_app
>
>  * you can use the WSGI app with all kinds of servers, not all of which
>    are based on TCP/IP (think CGI)
>
> But when you're actually processing a request, you should find the port
> number in the WSGI environment (SERVER_PORT, specifically).

Does Python actually support port 0?  And does the socket object
expose the port chosen?  I couldn't find anything in the library ref
about this.

-- 
Mike Orr <[email protected]>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to