Changeset 247 for PinConnection


Ignore:
Timestamp:
May 24, 2011, 12:36:12 PM (13 years ago)
Author:
george
Message:
  • Fixed: Various minor bugs and enhancements.
Location:
PinConnection
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • PinConnection/UCommPin.pas

    r119 r247  
    5151procedure TCommPin.Connect(Pin: TCommPin);
    5252begin
    53   if Assigned(Pin) then Disconnect;
    54   Self.RemotePin := Pin;
    55   Pin.RemotePin := Self;
     53  if Pin <> RemotePin then begin
     54    Pin.Disconnect;
     55    Disconnect;
     56    Self.RemotePin := Pin;
     57    Pin.RemotePin := Self;
     58  end;
    5659end;
    5760
  • PinConnection/UCommProtocol.pas

    r231 r247  
    101101      ResponseParameters: TVarBlockIndexed = nil;
    102102      RequestParameters: TVarBlockIndexed = nil; ARaiseError: boolean = True);
    103     constructor Create;
     103    constructor Create; virtual;
    104104    destructor Destroy; override;
     105    procedure Assign(Source: TCommProtocol); virtual;
    105106    property OnAfterRequest: TAfterRequest read FOnAfterRequest write FOnAfterRequest;
    106107    property OnCommand: TAfterRequest read FOnCommand write FOnCommand;
     
    360361end;
    361362
     363procedure TCommProtocol.Assign(Source: TCommProtocol);
     364begin
     365  LastCommandResponseTime := Source.LastCommandResponseTime;
     366  LastLatency := Source.LastLatency;
     367  MaxSequenceNumber := Source.MaxSequenceNumber;
     368  MaxSessionCount := Source.MaxSessionCount;
     369  RemoteBufferSize := Source.RemoteBufferSize;
     370  RemoteBufferUsed := Source.RemoteBufferUsed;
     371  WrongSequenceCount := Source.WrongSequenceCount;
     372  RetransmitTimeout := Source.RetransmitTimeout;
     373  RetransmitRepeatCount := Source.RetransmitRepeatCount;
     374  RetransmitTotalCount := Source.RetransmitTotalCount;
     375  Pin.Connect(Source.Pin.RemotePin);
     376  OnCommand := Source.OnCommand;
     377  OnAfterRequest := Source.OnAfterRequest;
     378  OnDebugLog := Source.OnDebugLog;
     379  Active := Source.Active;
     380end;
     381
    362382{ TDeviceProtocolSession }
    363383
Note: See TracChangeset for help on using the changeset viewer.