Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

void PTelnetSocket::OnWont ( BYTE  option  )  [protected, virtual]

This callback function is called by the system when it receives a WONT request from the remote system.

The default action is to disable options that are understood by the standard TELNET class. All others are ignored.

Parameters:
option  Option to WONT

Definition at line 851 of file telnet.cxx.

References DO, DONT, and SendCommand().

Referenced by Read().

{
  PTelnetError << "OnWont " << GetTELNETOptionName(code) << ' ';

  OptionInfo & opt = option[code];

  switch (opt.theirState) {
    case OptionInfo::IsNo :
      PDebugError << "ignored.";
      break;

    case OptionInfo::IsYes :
      PDebugError << "DONT.";
      opt.theirState = OptionInfo::IsNo;
      SendCommand(DONT, code);
      break;

    case OptionInfo::WantNo :
      PDebugError << "disabled.";
      opt.theirState = OptionInfo::IsNo;
      break;

    case OptionInfo::WantNoQueued :
      PDebugError << "accepting.";
      opt.theirState = OptionInfo::WantYes;
      SendCommand(DO, code);
      break;

    case OptionInfo::WantYes :
      PDebugError << "refused.";
      opt.theirState = OptionInfo::IsNo;
      break;

    case OptionInfo::WantYesQueued :
      PDebugError << "queued refusal.";
      opt.theirState = OptionInfo::IsNo;
      break;
  }

  PDebugError << endl;
}


Generated by  Doxygen 1.6.0   Back to index