Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Module « asyncio » Python 3.11.3

Classe « Protocol »

Informations générales

Héritage

builtins.object
    BaseProtocol
        Protocol

Définition

class Protocol(BaseProtocol):

help(Protocol)

Interface for stream protocol.

    The user should implement this interface.  They can inherit from
    this class but don't need to.  The implementations here do
    nothing (they don't raise exceptions).

    When the user wants to requests a transport, they pass a protocol
    factory to a utility function (e.g., EventLoop.create_connection()).

    When the connection is made successfully, connection_made() is
    called with a suitable transport object.  Then data_received()
    will be called 0 or more times with data (bytes) received from the
    transport; finally, connection_lost() will be called exactly once
    with either an exception object or None as an argument.

    State machine of calls:

      start -> CM [-> DR*] [-> ER?] -> CL -> end

    * CM: connection_made()
    * DR: data_received()
    * ER: eof_received()
    * CL: connection_lost()
    

Constructeur(s)

Signature du constructeur Description
__init__(self, /, *args, **kwargs) Initialize self. See help(type(self)) for accurate signature. [extrait de __init__.__doc__]

Liste des opérateurs

Opérateurs hérités de la classe object

__eq__, __ge__, __gt__, __le__, __lt__, __ne__

Liste des méthodes

Toutes les méthodes Méthodes d'instance Méthodes statiques Méthodes dépréciées
Signature de la méthodeDescription
data_received(self, data) Called when some data is received. [extrait de data_received.__doc__]
eof_received(self) Called when the other end calls write_eof() or equivalent. [extrait de eof_received.__doc__]

Méthodes héritées de la classe BaseProtocol

__init_subclass__, __subclasshook__, connection_lost, connection_made, pause_writing, resume_writing

Méthodes héritées de la classe object

__delattr__, __dir__, __format__, __getattribute__, __getstate__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__