@@ -117,7 +117,7 @@ async def open_websocket(
117117 extra_headers : Optional [list [tuple [bytes ,bytes ]]] = None ,
118118 message_queue_size : int = MESSAGE_QUEUE_SIZE ,
119119 max_message_size : int = MAX_MESSAGE_SIZE ,
120- receive_buffer_size : int = RECEIVE_BYTES ,
120+ receive_buffer_size : Union [ None , int ] = RECEIVE_BYTES ,
121121 connect_timeout : float = CONN_TIMEOUT ,
122122 disconnect_timeout : float = CONN_TIMEOUT
123123) -> AsyncGenerator [WebSocketConnection , None ]:
@@ -316,7 +316,7 @@ async def connect_websocket(
316316 extra_headers : list [tuple [bytes , bytes ]] | None = None ,
317317 message_queue_size : int = MESSAGE_QUEUE_SIZE ,
318318 max_message_size : int = MAX_MESSAGE_SIZE ,
319- receive_buffer_size : int = RECEIVE_BYTES ,
319+ receive_buffer_size : Union [ None , int ] = RECEIVE_BYTES ,
320320) -> WebSocketConnection :
321321 '''
322322 Return an open WebSocket client connection to a host.
@@ -394,7 +394,7 @@ def open_websocket_url(
394394 max_message_size : int = MAX_MESSAGE_SIZE ,
395395 connect_timeout : float = CONN_TIMEOUT ,
396396 disconnect_timeout : float = CONN_TIMEOUT ,
397- receive_buffer_size : int = RECEIVE_BYTES ,
397+ receive_buffer_size : Union [ None , int ] = RECEIVE_BYTES ,
398398) -> AbstractAsyncContextManager [WebSocketConnection ]:
399399 '''
400400 Open a WebSocket client connection to a URL.
@@ -447,7 +447,7 @@ async def connect_websocket_url(
447447 extra_headers : list [tuple [bytes , bytes ]] | None = None ,
448448 message_queue_size : int = MESSAGE_QUEUE_SIZE ,
449449 max_message_size : int = MAX_MESSAGE_SIZE ,
450- receive_buffer_size : int = RECEIVE_BYTES ,
450+ receive_buffer_size : Union [ None , int ] = RECEIVE_BYTES ,
451451) -> WebSocketConnection :
452452 '''
453453 Return an open WebSocket client connection to a URL.
@@ -540,7 +540,7 @@ async def wrap_client_stream(
540540 extra_headers : list [tuple [bytes , bytes ]] | None = None ,
541541 message_queue_size : int = MESSAGE_QUEUE_SIZE ,
542542 max_message_size : int = MAX_MESSAGE_SIZE ,
543- receive_buffer_size : int = RECEIVE_BYTES ,
543+ receive_buffer_size : Union [ None , int ] = RECEIVE_BYTES ,
544544) -> WebSocketConnection :
545545 '''
546546 Wrap an arbitrary stream in a WebSocket connection.
@@ -587,7 +587,7 @@ async def wrap_server_stream(
587587 stream : trio .abc .Stream ,
588588 message_queue_size : int = MESSAGE_QUEUE_SIZE ,
589589 max_message_size : int = MAX_MESSAGE_SIZE ,
590- receive_buffer_size : int = RECEIVE_BYTES ,
590+ receive_buffer_size : Union [ None , int ] = RECEIVE_BYTES ,
591591) -> WebSocketRequest :
592592 '''
593593 Wrap an arbitrary stream in a server-side WebSocket.
@@ -629,7 +629,7 @@ async def serve_websocket(
629629 handler_nursery : trio .Nursery | None = None ,
630630 message_queue_size : int = MESSAGE_QUEUE_SIZE ,
631631 max_message_size : int = MAX_MESSAGE_SIZE ,
632- receive_buffer_size : int = RECEIVE_BYTES ,
632+ receive_buffer_size : Union [ None , int ] = RECEIVE_BYTES ,
633633 connect_timeout : float = CONN_TIMEOUT ,
634634 disconnect_timeout : float = CONN_TIMEOUT ,
635635 task_status : trio .TaskStatus [WebSocketServer ] = trio .TASK_STATUS_IGNORED ,
@@ -994,7 +994,7 @@ def __init__(
994994 client_extra_headers : list [tuple [bytes , bytes ]] | None = None ,
995995 message_queue_size : int = MESSAGE_QUEUE_SIZE ,
996996 max_message_size : int = MAX_MESSAGE_SIZE ,
997- receive_buffer_size = RECEIVE_BYTES ,
997+ receive_buffer_size : Union [ None , int ] = RECEIVE_BYTES ,
998998 ) -> None :
999999 '''
10001000 Constructor.
@@ -1660,7 +1660,7 @@ def __init__(
16601660 handler_nursery : trio .Nursery | None = None ,
16611661 message_queue_size : int = MESSAGE_QUEUE_SIZE ,
16621662 max_message_size : int = MAX_MESSAGE_SIZE ,
1663- receive_buffer_size : int = RECEIVE_BYTES ,
1663+ receive_buffer_size : Union [ None , int ] = RECEIVE_BYTES ,
16641664 connect_timeout : float = CONN_TIMEOUT ,
16651665 disconnect_timeout : float = CONN_TIMEOUT ,
16661666 ) -> None :
0 commit comments