# Class Protocols.TELNET.protocol

Inheritance graph

Description

  Implementation of the TELNET protocol.

Variable cb

  ``protected` `mapping` Protocols.TELNET.protocol.cb`

Description

  Mapping containing extra callbacks.

Variable close_cb

  ``protected` `function`(`mixed`|`void`:`void`) Protocols.TELNET.protocol.close_cb`

Description

  Close callback.

Variable done

  ``protected` `int` Protocols.TELNET.protocol.done`

Description

  Indicates that connection should be closed

Variable fd

  ``protected` `object` Protocols.TELNET.protocol.fd`

Description

  The connection.

Variable id

  ``protected` `mixed` Protocols.TELNET.protocol.id`

Description

  Value to send to the callbacks.

Variable remote_options
Variable local_options

  ``protected` `array`(`int`) Protocols.TELNET.protocol.remote_options`
  ``protected` `array`(`int`) Protocols.TELNET.protocol.local_options`

Description

  Negotiation states of all WILL/WON'T options. See RFC 1143 for a description of the states.

Variable nonblocking_write

  ``protected` `int` Protocols.TELNET.protocol.nonblocking_write`

Description

  Tells if we have set the nonblocking write callback or not.

Variable read_cb

  ``protected` `function`(`mixed`, `string`:`void`) Protocols.TELNET.protocol.read_cb`

Description

  Read callback.

Variable synch

  ``protected` `int` Protocols.TELNET.protocol.synch`

Description

  Indicates whether we are in synch-mode or not.

Variable to_send

  ``protected` `string` Protocols.TELNET.protocol.to_send`

Description

  Data queued to be sent.

Variable write_cb

  ``protected` `function`(`mixed`|`void`:`string`) Protocols.TELNET.protocol.write_cb`

Description

  Write callback.

Method create

  `Protocols.TELNET.protocol Protocols.TELNET.protocol(`object` `f`, `function`(`mixed`, `string`:`void`) `r_cb`, `function`(`mixed`|`void`:`string`) `w_cb`, `function`(`mixed`|`void`:`void`) `c_cb`, `mapping` `callbacks`, `mixed`|`void` `new_id`)`

Description

  Creates a TELNET protocol handler, and sets its callbacks.

Parameter `f`

  File to use for the connection.

Parameter `r_cb`

  Function to call when data has arrived.

Parameter `w_cb`

  Function to call when the send buffer is empty.

Parameter `c_cb`

  Function to call when the connection is closed.

Parameter `callbacks`

  Mapping with callbacks for the various TELNET commands.

Parameter `new_id`

  Value to send to the various callbacks.