Commit d719fff7 authored by thomas alfroy's avatar thomas alfroy
Browse files

add second for debgu

parent ee1a0194
......@@ -110,13 +110,13 @@ def parse_new_messages_server(msg):
debug = False
verb = False
second = False
second = 0.0
ecn = False
hybride = False
options, remainder = getopt.getopt(sys.argv[1:], 'dvsehl:', ['debug', 'verbose', 'second', 'ecn', 'help', 'limit=',])
options, remainder = getopt.getopt(sys.argv[1:], 'dvsehl:', ['debug', 'verbose', 'second=', 'ecn', 'help', 'limit=',])
for opt, arg in options:
if opt in ('-d', '--debug'):
......@@ -124,7 +124,7 @@ for opt, arg in options:
if opt in ('-v', '--verbose'):
verb = True
if opt in ('-s', '--second'):
second = True
second = float(arg) / 1000.0
if opt in ('-e','--ecn'):
ecn = True
if opt in ('-l','--limit'):
......@@ -156,14 +156,14 @@ nb_packets = 0
tagged = False
while con:
if act_time + 1 <= time.time():
if second :
if act_time + second <= time.time():
if second != 0.0 :
print("{} packets received last second".format(nb_packets))
nb_packets = 0
act_time = time.time()
tagged = False
i_ready, o_ready, e_ready = select.select(input, [], [], 1.0)
i_ready, o_ready, e_ready = select.select(input, [], [], second)
for s in i_ready:
if s == sock_sender:
......
File added
File added
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment