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 wrap: on
line diff
--- a/viff/runtime.py	Thu Jan 21 11:21:09 2010 +0100
+++ b/viff/runtime.py	Thu Jan 21 11:31:36 2010 +0100
@@ -525,6 +525,9 @@
                          help="Collect and print profiling information.")
         group.add_option("--track-memory", action="store_true",
                          help="Track memory usage over time.")
+        group.add_option("--no-socket-retry", action="store_true",
+                         default=False, help="Fail rather than keep retrying "
+                         "to connect if port is already in use.")
 
         try:
             # Using __import__ since we do not use the module, we are
@@ -1068,6 +1071,8 @@
         try:
             runtime.port = listen(port)
         except CannotListenError, e:
+            if options and options.no_socket_retry:
+                raise
             delay *= 1 + rand.random()
             print "Error listening on port %d: %s" % (port, e.socketError[1])
             print "Will try again in %d seconds" % delay