File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ def __init__(self, socket_source: Protocol) -> None:
3131 in CircuitPython or the `socket` module in CPython.
3232 """
3333 self ._buffer = bytearray (1024 )
34- self ._timeout = 0
34+ self ._timeout = 1
3535 self .route_handlers = {}
3636 self ._socket_source = socket_source
3737 self ._sock = None
@@ -107,7 +107,7 @@ def poll(self):
107107 # Receiving data until timeout
108108 while "Receiving data" :
109109 try :
110- length = conn .recv_into (self ._buffer )
110+ length = conn .recv_into (self ._buffer , len ( self . _buffer ) )
111111 received_data += self ._buffer [:length ]
112112 except OSError as ex :
113113 if ex .errno == ETIMEDOUT :
@@ -192,9 +192,9 @@ def socket_timeout(self) -> int:
192192
193193 @socket_timeout .setter
194194 def socket_timeout (self , value : int ) -> None :
195- if isinstance (value , (int , float )) and value >= 0 :
195+ if isinstance (value , (int , float )) and value > 0 :
196196 self ._timeout = value
197197 else :
198- raise TypeError (
199- "HTTPServer.socket_timeout must be a non-negative numeric value."
198+ raise ValueError (
199+ "HTTPServer.socket_timeout must be a positive numeric value."
200200 )
You can’t perform that action at this time.
0 commit comments