djhfwk
Members-
Content Count
10 -
Joined
-
Last visited
Everything posted by djhfwk
-
procedure THttpCli.DoRequestSync(Rq : THttpRequest); { V7.04 Timeout added } var TimeOutMsec : UINT; bFlag : Boolean; dwWaitMs : DWORD; AbortRequired : Boolean; { V8.71 JK } AbortMsg : String; { V8.71 JK } begin DoRequestAsync(Rq); if not Assigned(FCtrlSocket.Counter) then FCtrlSocket.CreateCounter; FCtrlSocket.Counter.LastSendTick := IcsGetTickCount64; // Reset counter { V8.71 } if FMultiThreaded then dwWaitMs:= 10 else dwWaitMs:= 1000; TimeOutMsec := FTimeOut * 1000; while FState <> httpReady do begin {$IFDEF MSWINDOWS} if MsgWaitForMultipleObjects(0, Pointer(nil)^, FALSE, dwWaitMs, QS_ALLINPUT) = WAIT_OBJECT_0 then {$ENDIF} MessagePump; { V8.71 JK see if user wants to abandon this request } In multithread mode, i think we can use lower period for MsgWaitForMultipleObjects.
-
In some cases, I need synchronous functionality of dnsquery, so I made a change to OverbyteIcsDnsQuery.pas TDnsQuery now was inherited from TIcsWndControl. These functions were added. AAAALookup SendQuerySync MXLookupSync ALookupSync AAAALookupSync PTRLookupSync QueryAllSync QueryAnySync OverbyteIcsDnsQuery.pas
-
The UdpDataAvailable procedure should add len check before setlength, sometimes FUdpSocket.RcvdCount will return 0, and this will cause range error in delphi 11.1, although this can be turn off by uncheck the Range Check option in Project Options. procedure TSysLogServer.UdpDataAvailable(Sender: TObject; ErrCode: Word); var RawMessage : AnsiString; Len : Integer; Src : TSockAddrIn; SrcLen : Integer; SrcIP : AnsiString; SrcPort : AnsiString; begin SrcLen := SizeOf(Src); Len := FUdpSocket.RcvdCount; if Len = 0 then //this should be added, but will cause the UdpDataAvailable event hang randomly Exit; SetLength(RawMessage, Len); Len := FUdpSocket.ReceiveFrom(@RawMessage[1], Length(RawMessage), Src, SrcLen); if Len < 0 then Exit; SetLength(RawMessage, Len); SrcIP := IcsStrPas(inet_ntoa(Src.sin_addr)); SrcPort := AnsiString(IntToStr(ntohs(Src.sin_port))); if Assigned(FOnDataAvailable) then FOnDataAvailable(Self, SrcIP, SrcPort, RawMessage); end;
-
Range check error with TSysLogServer
djhfwk replied to djhfwk's topic in ICS - Internet Component Suite
🤣 seems the problem is in FUdpSocket.RcvdCount , when it return 0, i changed it to 65535 manually, FUdpSocket.ReceiveFrom still can successfuly got data -
The palette default order has been changed since 10.4?
djhfwk posted a topic in Delphi IDE and APIs
😥 I reset the order of palette, then the order can't be back..... In 10.2 , the default order is Standard->Additional->Win32->System->..... but for 10.4, it's Standard->Xml->Live bindings->Live bindings Misc->..... -
The palette default order has been changed since 10.4?
djhfwk replied to djhfwk's topic in Delphi IDE and APIs
In my prior snapshot, it's already the default order 😂, the reset palette function works -
Install recent Delphi versions on Windows XP
djhfwk replied to dummzeuch's topic in Delphi IDE and APIs
Radstudio 10.3 and later need NET 4.5, but XP do not support 4.5, so.... -
The palette default order has been changed since 10.4?
djhfwk replied to djhfwk's topic in Delphi IDE and APIs
Thanks, it's also in new order on OPTIONS, just curious why EMB changed it, reorder them manually is a disaster..... -
VCLEditors include "BrandingAPI", but nowhere to found BrandingAPI. - -! Does anyone found it? thank you
-
not only dll but also exe have these exports. if you have source, modify the source and use BuildRTLGroup to rebuild the source, no source, use the tool to remove the exports.