100const DefaultTelnetPort = 23;
103const DefaultConnTimeout = 15s;
106const DefaultTimeout = 100ms;
109const DefaultTerminalType =
"xterm";
112const DefaultTerminalSpeed = 38400;
118const IAC = 255; #!< IAC
119const DONT = 254; #!< DONT
120const DO = 253; #!< DO
121const WONT = 252; #!< WONT
122const WILL = 251; #!< WILL
123const SE = 240; #!< Subnegotiation End
124const NOP = 241; #!< No Operation
125const DM = 242; #!< Data Mark
126const BRK = 243; #!< Break
127const IP = 244; #!< Interrupt process
128const AO = 245; #!< Abort output
129const AYT = 246; #!< Are You There
130const EC = 247; #!< Erase Character
131const EL = 248; #!< Erase Line
132const GA = 249; #!< Go Ahead
133const SB = 250; #!< Subnegotiation Begin
140const SUPDUP_OPT = 21; # SUPDUP_OPT display protocol
145const TOPT_BIN = 0; #!< BinaryTransmission
146const TOPT_ECHO = 1; #!< Echo|Is|Send
147const TOPT_RECN = 2; #!< Reconnection
148const TOPT_SUPP = 3; #!< SuppressGoAhead
149const TOPT_APRX = 4; #!< ApproxMessageSizeNegotiation
150const TOPT_STAT = 5; #!< Status
151const TOPT_TIM = 6; #!< TimingMark
152const TOPT_REM = 7; #!< RemoteControlledTransandEcho
153const TOPT_OLW = 8; #!< OutputLineWidth
154const TOPT_OPS = 9; #!< OutputPageSize
155const TOPT_OCRD = 10; #!< OutputCarriage-ReturnDisposition
156const TOPT_OHT = 11; #!< OutputHorizontalTabstops
157const TOPT_OHTD = 12; #!< OutputHorizontalTabDisposition
158const TOPT_OFD = 13; #!< OutputFormfeedDisposition
159const TOPT_OVT = 14; #!< OutputVerticalTabstops
160const TOPT_OVTD = 15; #!< OutputVerticalTabDisposition
161const TOPT_OLD = 16; #!< OutputLinefeedDisposition
162const TOPT_EXT = 17; #!< ExtendedASCII
163const TOPT_LOGO = 18; #!< Logout
164const TOPT_BYTE = 19; #!< ByteMacro
165const TOPT_DATA = 20; #!< DataEntryTerminal
166const TOPT_SUP = 21; #!< SUPDUP
167const TOPT_SUPO = 22; #!< SUPDUPOutput
168const TOPT_SNDL = 23; #!< SendLocation
169const TOPT_TERM = 24; #!< TerminalType
170const TOPT_EOR = 25; #!< EndofRecord
171const TOPT_TACACS = 26; #!< TACACSUserIdent
172const TOPT_OM = 27; #!< OutputMarking
173const TOPT_TLN = 28; #!< TerminalLocationNumber
174const TOPT_3270 = 29; #!< Telnet3270Regime
175const TOPT_X3 = 30; #!< X.3PAD
176const TOPT_NAWS = 31; #!< NegotiateAboutWindowSize
177const TOPT_TS = 32; #!< TerminalSpeed
178const TOPT_RFC = 33; #!< RemoteFlowControl
179const TOPT_LINE = 34; #!< Linemode
180const TOPT_XDL = 35; #!< XDisplayLocation
181const TOPT_ENVIR = 36; #!< TelnetEnvironmentOption
182const TOPT_AUTH = 37; #!< TelnetAuthenticationOption
183const TOPT_ENVIR_NEW = 39; #!< TelnetNewEnvironmentOption
184const TOPT_TN3270 = 40; #!< TN3270Enhancements
185const TOPT_X_AUTH = 41; #!< TelnetXAUTH
186const TOPT_CHARSET = 42; #!< TelnetCHARSET
187const TOPT_RSP = 43; #!< TelnetRemoteSerialPort
188const TOPT_COMPORT = 44; #!< TelnetComPortControl
189const TOPT_SLE = 45; #!< TelnetSuppressLocalEcho
190const TOPT_STARTTLS = 46; #!< TelnetStartTLS
191const TOPT_KERMIT = 47; #!< TelnetKERMIT
192const TOPT_SEND_URL = 48; #!< Send-URL
193const TOPT_EXTOP = 255; #!< Extended-Options-List
279 connect(timeout timeout = DefaultConnTimeout);
449 nothing
setWarningQueue(
int warning_ms,
int warning_bs, Queue queue, any arg, timeout min_ms = 1s);
529 final disconnectIntern();
540 final sendDataIntern(softlist arr,
bool double_aic = False);
545 sendTextDataIntern(
string str);
551 final *
string getAvailableDataIntern(timeout t = DefaultTimeout);
557 final updateWindowSizeIntern(hash wh);
563 final processCmd(reference<string> rv);
569 final doSubNegotiation();
587 "cls": Class::forName(
"TelnetConnection"),
setEventQueue()
Removes any Queue object so that socket events are no longer added to the Queue.
int getTerminalSpeed()
this method provides the value that will be given as the terminal speed in protocol negotiation
string getTarget()
Returns the connection target string.
log(string msg)
logs the message to the log closure set with the constructor (if any)
constructor(string host, softint port, *code log, *code dbglog)
creates the TelnetClient object
disconnect()
disconnects from the Telnet server
constructor(string connect, *code log, *code dbglog)
creates the TelnetClient object from a target string and optional log closure(s)
connect(timeout timeout=DefaultConnTimeout)
connects to the Telnet server
nothing clearWarningQueue()
Removes any warning Queue object from the Socket.
sendData(softlist arr)
sends data to the server
hash getWindowSize()
this method provides the value that will be given as the terminal window size in protocol negotiation
clearStats()
Clears performance statistics.
hash< auto > getUsageInfo()
Returns performance statistics for the socket.
bool isConnected()
returns True if the client is connected to the server
windowSizeUpdated()
this method should be called externally when the window size has changed
sendTextData(string str)
sends literal string data to the server; the text dat is converted to the socket's encoding if necess...
*string getTerminalType()
this method provides the value that will be given as the terminal type in protocol negotiation
nothing setWarningQueue(int warning_ms, int warning_bs, Queue queue, any arg, timeout min_ms=1s)
Sets a Queue object to receive socket warnings.
setUser(*string n_user)
sets or clears (in case passed with no value) the username parameter for logging in to the telnet ser...
*string getAvailableData(timeout t=DefaultTimeout)
returns all data available as a string (which could be an empty string if no data is available in the...
hash getEnvironment()
this method provides the value that will be given as the user's environment in protocol negotiation
destructor()
disconnects from the server if connected and deletes the object
bool hasFeature(int fc)
returns True if the server has confirmed with a DO command that it supports the given feature
logDbg(string msg)
logs the message to the debug log closure set with the constructor (if any)
*string getDisplay()
this method provides the value that will be given as the DISPLAY value in protocol negotiation
setEventQueue(Qore::Thread::Queue queue, auto arg, *bool with_data)
Sets a Queue object to receive socket events.
*string getUser()
returns the current value of the username parameter
class for Telnet connections; returns an object of class TelnetClient for connecting to telnet sessio...
Definition: TelnetClient.qm.dox.h:582
string getType()
returns "telnet"
hash< ConnectionSchemeInfo > getConnectionSchemeInfoImpl()
Returns the ConnectionSchemeInfo hash for this object.
constructor(string name, string description, string url, hash attributes={}, hash options={})
creates the RestConnection connection object
const ConnectionScheme
Connection entry info.
Definition: TelnetClient.qm.dox.h:586
TelnetClient getImpl(bool connect=True, *hash rtopts)
returns an TelnetClient object
*hash< auto > getRuntimeOptions()
returns runtime options
const CmdMap
command name map
Definition: TelnetClient.qm.dox.h:136
const OptMap
option map, maps codes to text descriptions
Definition: TelnetClient.qm.dox.h:196
contains constant definitions and the definition of the TelnetClient class
Definition: TelnetClient.qm.dox.h:95