Skip to content

Commit 0aa8987

Browse files
committed
performance tuning for remote_demo
1 parent 1981d7e commit 0aa8987

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

remote_demo/demo_lib/DEMO.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
from demo_lib.I2C_Character_LCD import AE_AQM0802
2626

27+
NETWORK_TIMEOUT = False
2728
MEM_MONITORING = False
2829
# MEM_MONITORING = True ###
2930

@@ -93,7 +94,10 @@ def demo( ip = "dhcp" ):
9394
# print( ip_info )
9495

9596
s = socket.socket()
96-
s.settimeout( 1000 )
97+
98+
if NETWORK_TIMEOUT:
99+
s.settimeout( 1000 )
100+
97101
ai = socket.getaddrinfo( "0.0.0.0", 80 )
98102
addr = ai[0][-1]
99103

@@ -107,11 +111,14 @@ def demo( ip = "dhcp" ):
107111
count = 0
108112

109113
while True:
110-
try:
114+
if NETWORK_TIMEOUT:
115+
try:
116+
client_stream, client_addr = s.accept()
117+
except:
118+
# print( "*", end = "" )
119+
continue
120+
else:
111121
client_stream, client_addr = s.accept()
112-
except:
113-
# print( "*", end = "" )
114-
continue
115122

116123
e_time = elapsed_time( ticks_ms() ) ###
117124
# e_time.enable = True

0 commit comments

Comments
 (0)