reflex-libtelnet-0.1.0.0: Reflex bindings for libtelnet

Copyright(c) 2019 Jack Kelly
LicenseGPL-3.0-or-later
Maintainerjack@jackkelly.name
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Reflex.LibTelnet

Contents

Description

How to run a libtelnet state tracker off Reflex Events:

  1. Construct a TelnetConfig by using def to get an empty config, and then fill it out using record updates or lenses.
  2. Start a state tracker by calling telnet on your config.
  3. Wire the events from the returned TelnetEvents into the rest of your application.
Synopsis

Documentation

telnet :: forall t m. (MonadIO m, MonadIO (Performable m), PerformEvent t m, TriggerEvent t m) => TelnetConfig t -> m (TelnetEvents t) Source #

Process telnet streams using libtelnet. The easiest way to get a TelnetConfig t is through its Default instance; see TelnetConfig for details.

Since: 0.1.0.0

Input Events

data TelnetConfig t Source #

A TelnetConfig t contains all the input events for a telnet state tracker. When passed to telnet, the network will call each libtelnet function when its corresponding event fires. An "input event" describes all events the state tracker listens to; it doesn't care whether the events are coming from "above" or "below" itself in the application stack. Data arriving on the socket (_cRecv) is an "input event" from "below"; data pasing through libtelnet on its way out to the socket (_cSend) is also an "input event", but from "above".

You will almost certainly want to:

  1. use def to get an empty TelnetConfig;
  2. replace the _cRecv event with incoming socket data; and
  3. replace the _cSend event with outgoing data from your application.

Since: 0.1.0.0

Instances
Reflex t => Default (TelnetConfig t) Source #

No options set and all events are never.

Since: 0.1.0.0

Instance details

Defined in Reflex.LibTelnet

Methods

def :: TelnetConfig t #

Output Events

data TelnetEvents t Source #

The libtelnet Event type is fanned out into a set of individual "output events". An "output event" describes all events that should be listened to, regardless of whether they are going "up" or "down" the application stack: parsed data (_eReceived) is an "output event" that should be listened to by the layer "above"; encoded data that should go to a socket (_eSend) is also an "output event", but listened to by the layer below.

Since: 0.1.0.0

Constructors

TelnetEvents 

Fields

Lenses

TelnetConfig

cFlags :: forall t. Lens' (TelnetConfig t) [Flag] Source #

cIac :: forall t. Lens' (TelnetConfig t) (Event t Iac) Source #

cTTypeSend :: forall t. Lens' (TelnetConfig t) (Event t ()) Source #

TelnetEvents

eWarning :: forall t. Lens' (TelnetEvents t) (Event t Err) Source #

eError :: forall t. Lens' (TelnetEvents t) (Event t Err) Source #

eIac :: forall t. Lens' (TelnetEvents t) (Event t Iac) Source #

eWill :: forall t. Lens' (TelnetEvents t) (Event t Option) Source #

eWont :: forall t. Lens' (TelnetEvents t) (Event t Option) Source #

eDo :: forall t. Lens' (TelnetEvents t) (Event t Option) Source #

eDont :: forall t. Lens' (TelnetEvents t) (Event t Option) Source #

eZmp :: forall t. Lens' (TelnetEvents t) (Event t [ByteString]) Source #