Changeset 272 for PinConnection/UCommThread.pas
- Timestamp:
- Aug 30, 2011, 3:50:15 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
PinConnection/UCommThread.pas
r231 r272 19 19 public 20 20 Parent: TCommThread; 21 Stream: T MemoryStream;21 Stream: TStreamHelper; 22 22 procedure Execute; override; 23 23 constructor Create(CreateSuspended: Boolean; … … 53 53 procedure TCommThread.ReceiveData(Sender: TCommPin; Stream:TStream); 54 54 begin 55 Ext.Send(Stream);55 if FActive then Ext.Send(Stream); 56 56 end; 57 57 … … 115 115 116 116 procedure TCommThreadReceiveThread.Execute; 117 var118 StreamHelper: TStreamHelper;119 117 begin 120 118 try 121 StreamHelper := TStreamHelper.Create(Stream);122 119 with Parent do 123 120 repeat 124 if FDataAvailable.WaitFor(1) = wrSignaled then begin121 if FDataAvailable.WaitFor(1) = wrSignaled then 125 122 try 126 123 FInputBufferLock.Acquire; 127 124 Stream.Size := 0; 128 Stream Helper.WriteStream(FInputBuffer, FInputBuffer.Size);125 Stream.WriteStream(FInputBuffer, FInputBuffer.Size); 129 126 Pin.Send(Stream); 127 finally 128 FDataAvailable.ResetEvent; 130 129 FInputBuffer.Clear; 131 finally132 130 FInputBufferLock.Release; 133 end;134 131 end; // else Yield; 135 132 until Terminated; 136 133 finally 137 StreamHelper.Free;138 134 end; 139 135 end; … … 143 139 begin 144 140 inherited; 145 Stream := T MemoryStream.Create;141 Stream := TStreamHelper.Create; 146 142 end; 147 143
Note:
See TracChangeset
for help on using the changeset viewer.