Subject FB 2.5 trace, read trace data with isc_info_svc_timeout
Author marcinmisiewicz
Im trying to use new trace API. I can start/stop trace service.
I can read its output with isc_service_query but when there is no data left to read my app hangs and waits for data, so i decided i will add isc_info_svc_timeout param to the isc_service_query call. I use Delphi and IBX, i modified TIBCustomService.InternalServiceQuery to use timeout param but with no luck, I mean it looks like its ok, i can query trace data but when there is no more data my app still hangs and wiats for new data. What am I doing wrong?


Modified IBX code i use:


procedure TIBCustomService.InternalServiceQuery;
var
FTimeout: string;
PTimeout: PChar;
FTimeoutLen: short;
begin
//one second timeout
FTimeout := Char(isc_info_svc_timeout) + Char(1) + Char(0);
FTimeoutLen := Length(FTimeout);
PTimeout := nil;
IBAlloc(PTimeout, 0, FTimeoutLen);
Move(FTimeout[1], PTimeout[0], FTimeoutLen);

FQuerySPBLength := Length(FQueryParams);
if FQuerySPBLength = 0 then
IBError(ibxeQueryParamsError, [nil]);
IBAlloc(FQuerySPB, 0, FQuerySPBLength);
Move(FQueryParams[1], FQuerySPB[0], FQuerySPBLength);
if (FOutputBuffer = nil) then
IBAlloc(FOutputBuffer, 0, FBufferSize);
try
if call(FGDSLibrary.isc_service_query(StatusVector, @FHandle, nil,
FTimeoutLen, PTimeout,
FQuerySPBLength, FQuerySPB,
FBufferSize, FOutputBuffer), False) > 0 then
begin