I like the idea and I will add it asap. Thanks. Massimo
On Mar 22, 8:50 pm, Iceberg <[email protected]> wrote: > Hi Massimo, > > At least in Windows platform, when one "web2py -i 0.0.0.0 -p 8000" > process in running, I noticed that local administrator can still start > another "web2py -i 0.0.0.0 -p 8000" process without any error message, > but of course the second web2py process can not accept any request. So > I suggest to add some detect code at the beginning of web2py > launching. Something like this: > > def __main__(): > # parse commandline and get the bindIP and bindPort, then > detectAddr = '127.0.0.1' if bindIP=='0.0.0.0' else bindIP > try: urllib.urlopen('http://%s:%s'% (detectAddr, bindPort)).read() > except IOError: pass # the bindAddr and bindPort is vacant > else: sys.exit('%s:%s is occupied'%(detectAddr,bindPort)) > ...... # Go on to start web2py main process > > This code can let novice make fewer mistakes. > > Regards, > Iceberg --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" 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/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

