viff

changeset 1428:e120e8967257

Merged.
author Thomas P Jakobsen <tpj@cs.au.dk>
date Thu, 21 Jan 2010 11:31:36 +0100
parents 0cae74c348e8 2324d01c74e2
children b2b8e4a74cd6
files
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- a/viff/runtime.py	Thu Jan 21 11:21:09 2010 +0100
     1.2 +++ b/viff/runtime.py	Thu Jan 21 11:31:36 2010 +0100
     1.3 @@ -525,6 +525,9 @@
     1.4                           help="Collect and print profiling information.")
     1.5          group.add_option("--track-memory", action="store_true",
     1.6                           help="Track memory usage over time.")
     1.7 +        group.add_option("--no-socket-retry", action="store_true",
     1.8 +                         default=False, help="Fail rather than keep retrying "
     1.9 +                         "to connect if port is already in use.")
    1.10  
    1.11          try:
    1.12              # Using __import__ since we do not use the module, we are
    1.13 @@ -1068,6 +1071,8 @@
    1.14          try:
    1.15              runtime.port = listen(port)
    1.16          except CannotListenError, e:
    1.17 +            if options and options.no_socket_retry:
    1.18 +                raise
    1.19              delay *= 1 + rand.random()
    1.20              print "Error listening on port %d: %s" % (port, e.socketError[1])
    1.21              print "Will try again in %d seconds" % delay