Dart Telnet Control
Command Event
The command value received.
If Command is telnetDo, telnetDont, telnetWill or telnetWont, then this is the specified option.
Variant. If Command is telnetSubOption, then this is the suboption sequence in a Byte array.
Description
When the AutoOption property is set to False, the Telnet Control does not respond to Telnet commands, but instead fires the Command event. The application must have the appropriate code within this event to handle all option negotiation. The presence of this event allows the user to write sophisticated Telnet clients that can support any desired option, as well as Telnet server applications. The SendCommand method is used to send Telnet option negotiation sequences and commands.
Syntax
Visual Basic
Public Event Command( _
   ByVal Command As CommandConstants, _
   ByVal Opt As OptionConstants, _
   ByRef SubOption As Variant _
)
Parameters
Command
ValueDescription
telnetAbortOutputThe function AO.
telnetAreYouThereThe function AYT.
telnetBreakNetwork Virtual Terminal (NVT) BRK.
telnetDataMarkThe data stream portion of a Synch.
telnetDoAsk the Telnet host to DO the specified option.
telnetDontAsk the Telnet host to NOT DO the specified option.
telnetEraseCharacterThe function EC.
telnetEraseLineThe function EL.
telnetGoAheadThe GA Signal.
telnetIacThe Interpret as Command signal.
telnetInterruptProcessThe function IP.
telnetNoOperationThe Telnet client WILL agree to the specified option.
telnetSubOptionIndicates that what follows is sub-negotiation of the indicated option.
telnetSubOptionEndEnd of sub-negotiation parameters (not used by application)
telnetWillThe Telnet client WILL agree to the specified option.
telnetWontThe Telnet client WONT agree to the specified option.
The command value received.
Opt
ValueDescription
telnet3270RegimeControls the 3270 Regime option.
telnetAuthenticationControls the Authentication option.
telnetByteMacroControls the Byte Macro option.
telnetCharacterSetControls the Character Set option.
telnetComPortControls the COM Port option.
telnetDataEntryTerminalControls the Data Entry Terminal option.
telnetEchoControls echoing
telnetEndOfRecordControls the end of record option.
telnetEnvironmentControls the Enviroment option.
telnetExtendedASCIIControls the Extended ASCII option.
telnetExtendedOptionsListControls the Extended Options List option.
telnetLineModeControls the Line Mode option.
telnetLogoutControls the Logout option.
telnetNewEnvironmentControls the New Environment option.
telnetOutputMarkingControls the Output Marking option.
telnetSendLocationControls the Send Location option.
telnetStatusControls the Status option.
telnetSUPDUPOutputControls the SUPDUP Output option.
telnetSupressGoAheadsSuppresses GoAhead signalling
telnetTACACSUserIdentificationControls the TACACS User Identification option.
telnetTerminalLocationControls the Terminal Location option.
telnetTerminalTypeControls terminal type
telnetTimingMarkControls the Timing Mark option.
telnetToggleFlowControlControls the Flow Control option.
telnetTransmitBinaryControls the Transmit Binary option
telnetWindowSizeControls terminal window size
telnetX3PadControls the X.3 Pad option.
telnetXDisplayLocationControls the X Display Location.
If Command is telnetDo, telnetDont, telnetWill or telnetWont, then this is the specified option.
SubOption
Variant. If Command is telnetSubOption, then this is the suboption sequence in a Byte array.
Example
Private Sub Telnet1_Command(ByVal Command As DartTelnetCtl.CommandConstants, ByVal Opt As DartTelnetCtl.OptionConstants, SubOption As Variant)
On Error GoTo OnError ' use intrinsic error handling
	Select Case Command
	Case telnetSubOptionEnd
		' server wants to negotiate a sub-option
		If Opt = telnetTerminalType Then
			' negotiate TermType suboption for VT320
			Telnet1.SendCommand telnetSubOption, Opt, Chr$(0) & "vt320"
		ElseIf Opt = telnetWindowSize Then
			' want the server to set a window size of 80x32
			Telnet1.SendCommand telnetSubOption, Opt, Chr$(0) & Chr$(80) & Chr$(0) & Chr$(32)
		End If
	Case telnetDo
		' server wants us to enable an option
		If Opt = telnetTerminalType Then
			' want to subnegotiate TermType
			Telnet1.SendCommand telnetWill, Opt
		ElseIf Opt = telnetWindowSize Then
			' want to subnegotiate Window Size
			Telnet1.SendCommand telnetWill, Opt
		Else
			' refuse any other option being requested
			Telnet1.SendCommand telnetWont, Opt
		End If
	Case telnetDont
		' server wants to disable option&ldots;agree to it
		Telnet1.SendCommand telnetWont, Opt
	Case telnetWill
		' server wants to enable an option
		If Opt = telnetSupressGoAheads Then
			' do suppress go-aheads
			Telnet1.SendCommand telnetDo, Opt
		ElseIf Opt = telnetEcho Then
			' do echo characters sent
			Telnet1.SendCommand telnetDo, Opt
		Else
			' we don't agree to anything else
			Telnet1.SendCommand telnetDont, Opt
		End If
	Case telnetWont
		' fine with us
		Telnet1.SendCommand telnetDont, Opt
	End Select
	Exit Sub
OnError: ' Any error jumps here
	Debug.Print "Error #" + CStr(Err.Number) + ": " + Err.Description
End Sub
See Also

Telnet Object  | Telnet Members


Documentation Version 1.9.3.0
© 2020 Dart Communications. All Rights Reserved.
Send comments on this topic