p; WSAResetEvent(Event); Data := FTransport.Receive(False, 0); if Assigned(Data) then begin FLastActivity := Now; FInterpreter.InterpretData(Data); Data := nil; FLastActivity := Now; end; end; WAIT_OBJECT_0 + 1: while PeekMessage(msg, 0, 0, 0, PM_REMOVE) do DispatchMessage(msg); WAIT_TIMEOUT: if (FTimeout > 0) and ((Now - FLastActivity) > FTimeout) then FTransport.Connected := False; end; except FTransport.Connected := False; end; finally FInterpreter.Free; FInterpreter := nil; end; finally FTransport := nil; end; finally CoUninitialize; Synchronize(RemoveClient); end; end;
function TSocketDispatcherThread.QueryInterface(const IID: TGUID; out Obj): HResult; begin if GetInterface(IID, Obj) then Result := 0 else Result := E_NOINTERFACE; end;
function TSocketDispatcherThread._AddRef: Integer; begin Inc(FRefCount); Result := FRefCount; end;
function TSocketDispatcherThread._Release: Integer; begin Dec(FRefCount); Result := FRefCount; end; {TSocketDispatcherThread class over}