@@ -49,6 +49,10 @@ class Server(AbstractServer):
4949 ssl_handshake_timeout : float | None ,
5050 ) -> None : ...
5151
52+ if sys .version_info >= (3 , 13 ):
53+ def close_clients (self ) -> None : ...
54+ def abort_clients (self ) -> None : ...
55+
5256 def get_loop (self ) -> AbstractEventLoop : ...
5357 def is_serving (self ) -> bool : ...
5458 async def start_serving (self ) -> None : ...
@@ -222,7 +226,9 @@ class BaseEventLoop(AbstractEventLoop):
222226 happy_eyeballs_delay : float | None = None ,
223227 interleave : int | None = None ,
224228 ) -> tuple [Transport , _ProtocolT ]: ...
225- if sys .version_info >= (3 , 11 ):
229+
230+ if sys .version_info >= (3 , 13 ):
231+ # 3.13 added `keep_alive`.
226232 @overload
227233 async def create_server (
228234 self ,
@@ -237,6 +243,7 @@ class BaseEventLoop(AbstractEventLoop):
237243 ssl : _SSLContext = None ,
238244 reuse_address : bool | None = None ,
239245 reuse_port : bool | None = None ,
246+ keep_alive : bool | None = None ,
240247 ssl_handshake_timeout : float | None = None ,
241248 ssl_shutdown_timeout : float | None = None ,
242249 start_serving : bool = True ,
@@ -255,30 +262,48 @@ class BaseEventLoop(AbstractEventLoop):
255262 ssl : _SSLContext = None ,
256263 reuse_address : bool | None = None ,
257264 reuse_port : bool | None = None ,
265+ keep_alive : bool | None = None ,
258266 ssl_handshake_timeout : float | None = None ,
259267 ssl_shutdown_timeout : float | None = None ,
260268 start_serving : bool = True ,
261269 ) -> Server : ...
262- async def start_tls (
270+ elif sys .version_info >= (3 , 11 ):
271+ @overload
272+ async def create_server (
263273 self ,
264- transport : BaseTransport ,
265- protocol : BaseProtocol ,
266- sslcontext : ssl . SSLContext ,
274+ protocol_factory : _ProtocolFactory ,
275+ host : str | Sequence [ str ] | None = None ,
276+ port : int = ... ,
267277 * ,
268- server_side : bool = False ,
269- server_hostname : str | None = None ,
278+ family : int = ...,
279+ flags : int = ...,
280+ sock : None = None ,
281+ backlog : int = 100 ,
282+ ssl : _SSLContext = None ,
283+ reuse_address : bool | None = None ,
284+ reuse_port : bool | None = None ,
270285 ssl_handshake_timeout : float | None = None ,
271286 ssl_shutdown_timeout : float | None = None ,
272- ) -> Transport | None : ...
273- async def connect_accepted_socket (
287+ start_serving : bool = True ,
288+ ) -> Server : ...
289+ @overload
290+ async def create_server (
274291 self ,
275- protocol_factory : Callable [[], _ProtocolT ],
276- sock : socket ,
292+ protocol_factory : _ProtocolFactory ,
293+ host : None = None ,
294+ port : None = None ,
277295 * ,
296+ family : int = ...,
297+ flags : int = ...,
298+ sock : socket = ...,
299+ backlog : int = 100 ,
278300 ssl : _SSLContext = None ,
301+ reuse_address : bool | None = None ,
302+ reuse_port : bool | None = None ,
279303 ssl_handshake_timeout : float | None = None ,
280304 ssl_shutdown_timeout : float | None = None ,
281- ) -> tuple [Transport , _ProtocolT ]: ...
305+ start_serving : bool = True ,
306+ ) -> Server : ...
282307 else :
283308 @overload
284309 async def create_server (
@@ -314,6 +339,29 @@ class BaseEventLoop(AbstractEventLoop):
314339 ssl_handshake_timeout : float | None = None ,
315340 start_serving : bool = True ,
316341 ) -> Server : ...
342+
343+ if sys .version_info >= (3 , 11 ):
344+ async def start_tls (
345+ self ,
346+ transport : BaseTransport ,
347+ protocol : BaseProtocol ,
348+ sslcontext : ssl .SSLContext ,
349+ * ,
350+ server_side : bool = False ,
351+ server_hostname : str | None = None ,
352+ ssl_handshake_timeout : float | None = None ,
353+ ssl_shutdown_timeout : float | None = None ,
354+ ) -> Transport | None : ...
355+ async def connect_accepted_socket (
356+ self ,
357+ protocol_factory : Callable [[], _ProtocolT ],
358+ sock : socket ,
359+ * ,
360+ ssl : _SSLContext = None ,
361+ ssl_handshake_timeout : float | None = None ,
362+ ssl_shutdown_timeout : float | None = None ,
363+ ) -> tuple [Transport , _ProtocolT ]: ...
364+ else :
317365 async def start_tls (
318366 self ,
319367 transport : BaseTransport ,
0 commit comments