Changeset 440 for PinConnection/UCommTelnet.pas
- Timestamp:
- Nov 19, 2012, 2:43:40 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
PinConnection/UCommTelnet.pas
r416 r440 6 6 7 7 uses 8 Classes, SysUtils, UCommPin, SpecializedList, DateUtils, UStreamHelper,9 SpecializedStream,UBinarySerializer;8 Classes, SysUtils, UCommPin, SpecializedList, DateUtils, Dialogs, 9 UBinarySerializer; 10 10 11 11 type … … 74 74 FState: TTelnetState; 75 75 FCommandData: TBinarySerializer; 76 procedure SetActive(AValue: Boolean);77 76 procedure TelnetDataReceive(Sender: TCommPin; Stream: TListByte); 78 77 procedure RawDataReceive(Sender: TCommPin; Stream: TListByte); … … 80 79 function ResponseCount: Integer; 81 80 protected 81 procedure SetActive(const AValue: Boolean); override; 82 82 procedure AssignTo(Dest: TPersistent); override; 83 83 public … … 153 153 RequestData.Free; 154 154 end; 155 Result := SupportedByServer; 155 156 end; 156 157 … … 159 160 RequestData: TBinarySerializer; 160 161 ResponseData: TBinarySerializer; 161 I: Integer;162 162 begin 163 163 if Telnet.OptionsNegotationEnable then CheckOption; … … 210 210 end; 211 211 212 procedure TCommTelnet.SetActive( AValue: Boolean);212 procedure TCommTelnet.SetActive(const AValue: Boolean); 213 213 var 214 214 I: Integer; … … 376 376 end; 377 377 378 function ByteToStr(Value: Byte): string; 379 begin 380 Result := IntToStr(Value); 381 end; 382 378 383 procedure TCommTelnet.SendCommand(Code: TTelnetCode; Request, 379 384 Response: TListByte); … … 405 410 if Code = tcSB then begin 406 411 if (Response[Response.Count - 2] <> Byte(tcIAC)) or 407 (Response[Response.Count - 1] <> Byte(tcSE)) then 412 (Response[Response.Count - 1] <> Byte(tcSE)) then begin 413 ShowMessage(Response.Implode(' ', ByteToStr)); 414 ReadResponse(Response); 415 ShowMessage(Response.Implode(' ', ByteToStr)); 408 416 raise Exception.Create(SWrongResponse); 417 end; 409 418 Response.DeleteItems(Response.Count - 2, 2); 410 419 end; 411 420 // Remove IAC escape character from data 412 421 I := 0; 422 LastIAC := False; 413 423 while (I < Response.Count) do begin 414 424 if Response[I] = Byte(tcIAC) then begin
Note:
See TracChangeset
for help on using the changeset viewer.