101const DefaultTelnetPort = 23;
104const DefaultConnTimeout = 15s;
107const DefaultTimeout = 100ms;
110const DefaultTerminalType =
"xterm";
113const DefaultTerminalSpeed = 38400;
119const IAC = 255; #!< IAC
120const DONT = 254; #!< DONT
121const DO = 253; #!< DO
122const WONT = 252; #!< WONT
123const WILL = 251; #!< WILL
124const SE = 240; #!< Subnegotiation End
125const NOP = 241; #!< No Operation
126const DM = 242; #!< Data Mark
127const BRK = 243; #!< Break
128const IP = 244; #!< Interrupt process
129const AO = 245; #!< Abort output
130const AYT = 246; #!< Are You There
131const EC = 247; #!< Erase Character
132const EL = 248; #!< Erase Line
133const GA = 249; #!< Go Ahead
134const SB = 250; #!< Subnegotiation Begin
141const SUPDUP_OPT = 21; # SUPDUP_OPT display protocol
146const TOPT_BIN = 0; #!< BinaryTransmission
147const TOPT_ECHO = 1; #!< Echo|Is|Send
148const TOPT_RECN = 2; #!< Reconnection
149const TOPT_SUPP = 3; #!< SuppressGoAhead
150const TOPT_APRX = 4; #!< ApproxMessageSizeNegotiation
151const TOPT_STAT = 5; #!< Status
152const TOPT_TIM = 6; #!< TimingMark
153const TOPT_REM = 7; #!< RemoteControlledTransandEcho
154const TOPT_OLW = 8; #!< OutputLineWidth
155const TOPT_OPS = 9; #!< OutputPageSize
156const TOPT_OCRD = 10; #!< OutputCarriage-ReturnDisposition
157const TOPT_OHT = 11; #!< OutputHorizontalTabstops
158const TOPT_OHTD = 12; #!< OutputHorizontalTabDisposition
159const TOPT_OFD = 13; #!< OutputFormfeedDisposition
160const TOPT_OVT = 14; #!< OutputVerticalTabstops
161const TOPT_OVTD = 15; #!< OutputVerticalTabDisposition
162const TOPT_OLD = 16; #!< OutputLinefeedDisposition
163const TOPT_EXT = 17; #!< ExtendedASCII
164const TOPT_LOGO = 18; #!< Logout
165const TOPT_BYTE = 19; #!< ByteMacro
166const TOPT_DATA = 20; #!< DataEntryTerminal
167const TOPT_SUP = 21; #!< SUPDUP
168const TOPT_SUPO = 22; #!< SUPDUPOutput
169const TOPT_SNDL = 23; #!< SendLocation
170const TOPT_TERM = 24; #!< TerminalType
171const TOPT_EOR = 25; #!< EndofRecord
172const TOPT_TACACS = 26; #!< TACACSUserIdent
173const TOPT_OM = 27; #!< OutputMarking
174const TOPT_TLN = 28; #!< TerminalLocationNumber
175const TOPT_3270 = 29; #!< Telnet3270Regime
176const TOPT_X3 = 30; #!< X.3PAD
177const TOPT_NAWS = 31; #!< NegotiateAboutWindowSize
178const TOPT_TS = 32; #!< TerminalSpeed
179const TOPT_RFC = 33; #!< RemoteFlowControl
180const TOPT_LINE = 34; #!< Linemode
181const TOPT_XDL = 35; #!< XDisplayLocation
182const TOPT_ENVIR = 36; #!< TelnetEnvironmentOption
183const TOPT_AUTH = 37; #!< TelnetAuthenticationOption
184const TOPT_ENVIR_NEW = 39; #!< TelnetNewEnvironmentOption
185const TOPT_TN3270 = 40; #!< TN3270Enhancements
186const TOPT_X_AUTH = 41; #!< TelnetXAUTH
187const TOPT_CHARSET = 42; #!< TelnetCHARSET
188const TOPT_RSP = 43; #!< TelnetRemoteSerialPort
189const TOPT_COMPORT = 44; #!< TelnetComPortControl
190const TOPT_SLE = 45; #!< TelnetSuppressLocalEcho
191const TOPT_STARTTLS = 46; #!< TelnetStartTLS
192const TOPT_KERMIT = 47; #!< TelnetKERMIT
193const TOPT_SEND_URL = 48; #!< Send-URL
194const TOPT_EXTOP = 255; #!< Extended-Options-List
280 connect(timeout timeout = DefaultConnTimeout);
450 nothing
setWarningQueue(
int warning_ms,
int warning_bs, Queue queue, any arg, timeout min_ms = 1s);
530 final disconnectIntern();
541 final sendDataIntern(softlist arr,
bool double_aic = False);
546 sendTextDataIntern(
string str);
552 final *
string getAvailableDataIntern(timeout t = DefaultTimeout);
558 final updateWindowSizeIntern(hash wh);
564 final processCmd(reference<string> rv);
570 final doSubNegotiation();
588 "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:583
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:587
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:137
const OptMap
option map, maps codes to text descriptions
Definition: TelnetClient.qm.dox.h:197
contains constant definitions and the definition of the TelnetClient class
Definition: TelnetClient.qm.dox.h:96