@@ -276,15 +276,15 @@ async def restore(self):
276276class _ServerState (enum .Enum ):
277277 """This tracks the state of Server.
278278
279- -[in]->INITIALIZED -[ss]-> SERVING -[cl]-> CLOSED -[wk]*-> SHUTDOWN
279+ -[in]->NOT_STARTED -[ss]-> SERVING -[cl]-> CLOSED -[wk]*-> SHUTDOWN
280280
281281 - in: Server.__init__()
282282 - ss: Server._start_serving()
283283 - cl: Server.close()
284284 - wk: Server._wakeup() *only called if number of clients == 0
285285 """
286286
287- INITIALIZED = "initialized "
287+ NOT_STARTED = "not_started "
288288 SERVING = "serving"
289289 CLOSED = "closed"
290290 SHUTDOWN = "shutdown"
@@ -305,7 +305,7 @@ def __init__(self, loop, sockets, protocol_factory, ssl_context, backlog,
305305 self ._ssl_context = ssl_context
306306 self ._ssl_handshake_timeout = ssl_handshake_timeout
307307 self ._ssl_shutdown_timeout = ssl_shutdown_timeout
308- self ._state = _ServerState .INITIALIZED
308+ self ._state = _ServerState .NOT_STARTED
309309 self ._serving_forever_fut = None
310310
311311 def __repr__ (self ):
@@ -319,9 +319,9 @@ def _attach(self, transport):
319319 def _detach (self , transport ):
320320 self ._clients .discard (transport )
321321 if self ._state == _ServerState .CLOSED and len (self ._clients ) == 0 :
322- self ._wakeup ()
322+ self ._shutdown ()
323323
324- def _wakeup (self ):
324+ def _shutdown (self ):
325325 if self ._state == _ServerState .CLOSED :
326326 self ._state = _ServerState .SHUTDOWN
327327 elif self ._state == _ServerState .SHUTDOWN :
@@ -339,7 +339,7 @@ def _wakeup(self):
339339 waiter .set_result (None )
340340
341341 def _start_serving (self ):
342- if self ._state == _ServerState .INITIALIZED :
342+ if self ._state == _ServerState .NOT_STARTED :
343343 self ._state = _ServerState .SERVING
344344 elif self ._state == _ServerState .SERVING :
345345 return
@@ -385,7 +385,7 @@ def close(self):
385385 self ._serving_forever_fut = None
386386
387387 if len (self ._clients ) == 0 :
388- self ._wakeup ()
388+ self ._shutdown ()
389389
390390 def close_clients (self ):
391391 for transport in self ._clients .copy ():
0 commit comments