Changeset 163 for PinConnection/UCommSocket.pas
- Timestamp:
- Feb 8, 2011, 11:02:02 AM (14 years ago)
- Location:
- PinConnection
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
PinConnection
- Property svn:ignore
-
old new 1 1 lib 2 backup
-
- Property svn:ignore
-
PinConnection/UCommSocket.pas
r129 r163 6 6 7 7 uses 8 Classes, SysUtils, blcksock, UCommPin, UCommon; 8 Classes, SysUtils, blcksock, UCommPin, UCommon, UMicroThreading, 9 DateUtils; 9 10 10 11 type … … 15 16 { TCommSocketReceiveThread } 16 17 17 TCommSocketReceiveThread = class(T Thread)18 TCommSocketReceiveThread = class(TMicroThread) 18 19 public 19 20 Parent: TCommSocket; … … 93 94 InBufferUsed := 0; 94 95 with Parent do repeat 95 try96 if InBufferUsed = 0 then Sleep(1);96 if InBufferUsed = 0 then MTSleep(1 * OneMillisecond) 97 else Yield; 97 98 if Assigned(Socket) then 98 99 with Socket do 99 if CanRead( 100) then begin100 if CanRead(0) then begin 100 101 InBufferUsed := WaitingData; 101 102 if InBufferUsed > 0 then begin … … 109 110 end else InBufferUsed := 0; 110 111 end else InBufferUsed := 0; 111 except112 on E: Exception do113 if Assigned(ExceptionHandler) then ExceptionHandler(Self, E);114 end;115 112 until Terminated; 116 113 end;
Note:
See TracChangeset
for help on using the changeset viewer.