Module provides class BaseServer.
BaseServer(shell=None, log=None, loop=None, _waiter_connected=None, _waiter_closed=None, encoding='utf8', encoding_errors='strict', force_binary=False, connect_maxwait=4.0, limit=None)¶
Base Telnet Server Protocol.
Begin advanced negotiation.
Callback method further requests advanced telnet options. Called once on receipt of any
WILLacknowledgments received, indicating that the remote end is capable of negotiating further.
Only called if sub-classing
begin_negotiation()causes at least one negotiation option to be affirmatively acknowledged.
Begin on-connect negotiation.
A Telnet server is expected to demand preferred session options immediately after connection. Deriving implementations should always call
Callback, return whether negotiation is complete.
Parameters: final¶ (bool) – Whether this is the final time this callback will be requested to answer regarding protocol negotiation. Returns: Whether negotiation is over (server end is satisfied). Return type: bool
Method is called on each new command byte processed until negotiation is considered final, or after
connect_maxwaithas elapsed, setting
super().check_negotiation()is called and conditionally combined when derived.
Called when the connection is lost or closed.
Parameters: exc¶ (Exception) – exception.
Noneindicates close by EOF.
Called when a connection is made.
super().connection_made(transport)is called when derived.
Process bytes received by transport.
Time elapsed since client connected, in seconds as float.
Encoding that should be used for the direction indicated.
The base implementation always returns
default_encodingor, when unspecified,
Called when the other end calls write_eof() or equivalent.
This callback may be exercised by the nc(1) client argument
Get optional server protocol or transport information.
Time elapsed since data last received, in seconds as float.
Whether advanced negotiation should commence.
Return type: bool Returns: True if advanced negotiation should be permitted.
The base implementation returns True if any negotiation options were affirmatively acknowledged by client, more than likely options requested in callback