@@ -55,13 +55,15 @@ def __init__(
5555 * ,
5656 ping_interval : float | None = 20 ,
5757 ping_timeout : float | None = 20 ,
58+ ping_data : Data | None = None ,
5859 close_timeout : float | None = 10 ,
5960 max_queue : int | None | tuple [int | None , int | None ] = 16 ,
6061 write_limit : int | tuple [int , int | None ] = 2 ** 15 ,
6162 ) -> None :
6263 self .protocol = protocol
6364 self .ping_interval = ping_interval
6465 self .ping_timeout = ping_timeout
66+ self .ping_data = ping_data
6567 self .close_timeout = close_timeout
6668 self .max_queue : tuple [int | None , int | None ]
6769 if isinstance (max_queue , int ) or max_queue is None :
@@ -825,7 +827,7 @@ async def keepalive(self) -> None:
825827 # connection to be closed before raising ConnectionClosed.
826828 # However, connection_lost() cancels keepalive_task before
827829 # it gets a chance to resume excuting.
828- pong_waiter = await self .ping ()
830+ pong_waiter = await self .ping (self . ping_data )
829831 if self .debug :
830832 self .logger .debug ("% sent keepalive ping" )
831833
0 commit comments