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

BOOL PTelnetSocket::SendWill ( BYTE  option  )  [virtual]

Send WILL request.

Returns:
TRUE if the command was successfully sent.
Parameters:
option  Option to WILL

Definition at line 395 of file telnet.cxx.

References PChannel::IsOpen(), SendCommand(), and WILL.

Referenced by Accept(), Connect(), and SetWindowSize().

{
  if (!StartSend("SendWill", code))
    return FALSE;

  if (!IsOpen())
    return FALSE;

  OptionInfo & opt = option[code];

  switch (opt.ourState) {
    case OptionInfo::IsNo :
      PDebugError << "initiated.";
      SendCommand(WILL, code);
      opt.ourState = OptionInfo::WantYes;
      break;

    case OptionInfo::IsYes :
      PDebugError << "already enabled." << endl;
      return FALSE;

    case OptionInfo::WantNo :
      PDebugError << "queued.";
      opt.ourState = OptionInfo::WantNoQueued;
      break;

    case OptionInfo::WantNoQueued :
      PDebugError << "already queued." << endl;
      opt.ourState = OptionInfo::IsNo;
      return FALSE;

    case OptionInfo::WantYes :
      PDebugError << "already negotiating." << endl;
      opt.ourState = OptionInfo::IsNo;
      return FALSE;

    case OptionInfo::WantYesQueued :
      PDebugError << "dequeued.";
      opt.ourState = OptionInfo::WantYes;
      break;
  }

  PDebugError << endl;
  return TRUE;
}


Generated by  Doxygen 1.6.0   Back to index