PowerTCP Emulation for .NET
ClientOptions Property
Example 




Gets a collection of desired client options.
Syntax
Public ReadOnly Property ClientOptions As OptionCollection
Dim instance As Telnet
Dim value As OptionCollection
 
value = instance.ClientOptions
public OptionCollection ClientOptions {get;}
public: __property OptionCollection* get_ClientOptions();
public:
property OptionCollection^ ClientOptions {
   OptionCollection^ get();
}
Remarks

The client will send a WILL command for the options within the collection.

Example
The following example demonstrates how to set options for automatic option negotiation.
if (telnet1.RemoteEndPoint.Port == 23)
{
    //Standard telnet port, add standard telnet options
    telnet1.ClientOptions.Add(new Option(OptionCode.SuppressGoAheads, null, OptionState.RequestOn));
    telnet1.ClientOptions.Add(new Option(OptionCode.WindowSize,
        new Byte[] { ((Byte)(0)), ((Byte)(80)), ((Byte)(0)), ((Byte)(24)) }, OptionState.RequestOn));
    telnet1.ClientOptions.Add(new Option(OptionCode.TerminalType,
        new System.Byte[] { ((Byte)(0)), ((Byte)(116)), ((Byte)(116)), ((Byte)(121)) }, OptionState.RequestOn));

    telnet1.ServerOptions.Add(new Option(OptionCode.SuppressGoAheads, null, OptionState.RequestOn));
    telnet1.ServerOptions.Add(new Option(OptionCode.Echo, null, OptionState.RequestOn));
    telnet1.ServerOptions.Add(new Option(OptionCode.OutputPageSize, null, OptionState.RequestOn));
}
else
{
    //Non-standard telnet port, do not send telnet options
    telnet1.ClientOptions.Clear();
    telnet1.ServerOptions.Clear();
}
If telnet1.RemoteEndPoint.Port = 23 Then
    'Standard telnet port, add standart telnet options
    telnet1.ClientOptions.Add(New [Option](OptionCode.SuppressGoAheads, Nothing, OptionState.RequestOn))
    telnet1.ClientOptions.Add(New [Option](OptionCode.WindowSize, _
        New System.Byte() { (CByte(0)), (CByte(80)), (CByte(0)), (CByte(24)) }, OptionState.RequestOn))
    telnet1.ClientOptions.Add(New [Option](OptionCode.TerminalType, _
        New System.Byte() { (CByte(0)), (CByte(116)), (CByte(116)), (CByte(121)) }, OptionState.RequestOn))

    telnet1.ServerOptions.Add(New [Option](OptionCode.SuppressGoAheads, Nothing, OptionState.RequestOn))
    telnet1.ServerOptions.Add(New [Option](OptionCode.Echo, Nothing, OptionState.RequestOn))
    telnet1.ServerOptions.Add(New [Option](OptionCode.OutputPageSize, Nothing, OptionState.RequestOn))
Else
    'Non-standard telnet port, do not send telnet options
    telnet1.ClientOptions.Clear()
    telnet1.ServerOptions.Clear()
End If
See Also

Reference

Telnet Class
Telnet Members


PowerTCP Emulation for .NET Documentation Version 4.7
© 2018 Dart Communications. All Rights Reserved.
Send comments on this topic