Welcome, Guest |
You have to register before you can post on our site.
|
Latest Threads |
Cookies with the SameSite...
Forum: IntraWeb General Discussion
Last Post: valmeras
Yesterday, 06:59 PM
» Replies: 0
» Views: 26
|
303 Redirect and Response...
Forum: IntraWeb General Discussion
Last Post: ALW2019
03-26-2024, 02:30 PM
» Replies: 0
» Views: 66
|
smmFunctions.pas
Forum: IntraWeb General Discussion
Last Post: Mikael Nilsson
03-26-2024, 10:33 AM
» Replies: 0
» Views: 71
|
TIWjQDBGrid paging
Forum: IntraWeb General Discussion
Last Post: troberts
03-26-2024, 04:06 AM
» Replies: 0
» Views: 90
|
iw15.5.10 does not addres...
Forum: IntraWeb General Discussion
Last Post: rudyPos
03-25-2024, 12:09 PM
» Replies: 0
» Views: 125
|
Problem with cache and 40...
Forum: IntraWeb General Discussion
Last Post: troberts
03-25-2024, 01:54 AM
» Replies: 0
» Views: 97
|
IWModalWindow from differ...
Forum: IntraWeb General Discussion
Last Post: bjoernb
03-24-2024, 10:52 PM
» Replies: 0
» Views: 110
|
jQGrid css and js files
Forum: IntraWeb General Discussion
Last Post: medzoom
03-22-2024, 07:06 PM
» Replies: 2
» Views: 2,511
|
iwSelect list update in a...
Forum: IntraWeb General Discussion
Last Post: joelcc
03-20-2024, 08:07 PM
» Replies: 0
» Views: 138
|
IntraWeb Certificate Mana...
Forum: IntraWeb General Discussion
Last Post: DavidChiq
03-19-2024, 06:27 PM
» Replies: 1
» Views: 2,083
|
|
|
Google LibPhonenumber import issues |
Posted by: cpstevenc - 01-31-2024, 06:13 PM - Forum: CrossTalk General Discussion
- No Replies
|
|
Greetings.. using latest CrossTalk demo and Delphi 11.3 for win32
DCL: 2.0.32
NET: 533320
Middle (x86): 2.0.32
Right: 2.0.32
UI: 2.0.32
I am messing around with Google LibPhonenumber for C# ( For life of me can't get CPP version to compile so gave up. )
Originally I found this @ landrix/LibPhonenumber-for-Delphi: Delphi-wrapper for the .NET port of Google's libphonenumber for parsing, formatting and validating international phone numbers. (github.com)
And for most part it works. Looks like he wrote a middle man DLL type deal to go between Delphi and the .NET DLL ... but only covers 2 calls of the over all library.
Limited, but does work.
Then I remembered CrossTalk and gave it A whirl.
It created a NET.PhoneNumbers.pas file
But it is missing a few things....?
Unreferenced <--- not sure?
Code: PhoneNumberUtil = class(TCTBaseObject)
private
class function ValidStartCharPatternRead: Unreferenced; static; /// <--- lots of references in the source import for "Unreferenced"
class procedure ValidStartCharPatternWrite(const aValue: Unreferenced); static;
protected
class function CTFullTypeName: string; override;
public const
..
..
RegexOptions <-- only used once... but I think? I just need to import some other .NET library to include this regex engine maybe?
Code: PhoneRegex = class(TCTBaseObject)
private
protected
class function CTFullTypeName: string; override;
public
constructor Create(const aPattern: string); reintroduce; overload;
constructor Create(const aPattern: string; const aOptions: RegexOptions); reintroduce; overload; <--- only reference
function IsMatch(const aValue: string): Boolean; overload;
TCTObject <--- Atozed.CrossTalk.BaseObject has no mention of this?
TypeNET <--- this i get as Type is a reserved word... so it must create TypeNet ... but i figure this is to be something else really in the end?
Pretty much every object has this "Equals" call that references TCTObject the and GetType:TypeNet;
Code: AreaCodeMapStorageStrategy = class(TCTBaseObject)
private
protected
class function CTFullTypeName: string; override;
public
function GetPrefix(const aIndex: Int32): Int32; overload;
function GetStorageSize: Int32; overload;
function GetDescription(const aIndex: Int32): string; overload;
function GetNumOfEntries: Int32; overload;
function ToString: string; reintroduce; overload;
function Equals(const aObj: TCTObject): Boolean; reintroduce; overload; <--------- every TCTBaseObject seems to have this
function GetHashCode: Int32; reintroduce; overload;
function GetType: TypeNET; overload; <--------- every TCTBaseObject seems to have this
end;
For now I just did this to get by
Code: RegexOptions = class
end;
Unreferenced = class
end;
TCTObject = class
end;
TypeNET = class
end;
And it compiles...
And it runs....
Code: Uses NET.PhoneNumbers, ...
..
..
var
p: string;
r: boolean;
begin
Memo1.Clear;
p := '18594091234';
r := PhoneNumberUtil.IsViablePhoneNumber(p);
Memo1.Lines.Add(format('phone %s is %s', [p, BoolToStr(r)])); // -1 returned = true
p := 'dumbstuff';
r := PhoneNumberUtil.IsViablePhoneNumber(p);
Memo1.Lines.Add(format('phone %s is %s', [p, BoolToStr(r )])); // 0 returned = false
end;
I imported a small DLL I wrote in C# ... Add/Subtract kind of deal. Just to play with.
And it too created references to TCTObject the and GetType:TypeNet;
This the win32 .NET DLL I imported
https://github.com/landrix/LibPhonenumbe...umbers.dll
|
|
|
whats about Grids ? |
Posted by: joergb - 01-31-2024, 03:45 PM - Forum: IntraWeb General Discussion
- No Replies
|
|
in normaly VLC app's I use a lot of Grids. Its simple to handle and the user gets a quick overview about his data.
But it seems , in Intraweb , they are treat like a bad thing.
I found no way to gets a 'Cursor' in TIWGrid to show the Current Row . I don't get a event , if a Row or a Col is clicked and so on.
So I use TIWListbox with a non proportinal font .
In dbGrid I found here in Forum a way to use it , and show the current record. I think, its a workaround using colums and reread the table by every change of that colums. But it works for small tables.
Did I miss something or accidently ignore it ? Or exist a better component ie to show a couple of data, and let the user choose one of them to work with ?
|
|
|
TIdFTPServer slow-ish |
Posted by: OzAWebb - 01-29-2024, 12:45 PM - Forum: Indy General Discussion
- Replies (2)
|
|
G'day from Downunder,
Indy10, as supplied with Delphi 2006 (sorry, can't recall whether I've updated it).
Using IdFTPServer to receive files from a third-party hardware device.
Device sends files in batches of 200 or more of small 30k-ish files.
Device establishes a new FTP connection - login etc - for every file and disconnects after each, then immediately logs in for the next file.
Device uses passive PASV data transfer.
Sample data capture from Wireshark:
No. Time Source Destination Prt Len Info
18 49:56.2 192.168.11.102 192.168.11.100 FTP 60 Request: PASV
19 49:56.2 192.168.11.100 192.168.11.102 FTP 104 Response: 227 Entering Passive Mode (192,168,11,100,0,20).
20 49:56.2 192.168.11.102 192.168.11.100 TCP 60 49250 > 20 [SYN] Seq=0 Win=4096 Len=0 MSS=1024
21 49:56.2 192.168.11.100 192.168.11.102 TCP 58 20 > 49250 [SYN, ACK] Seq=0 Ack=1 Win=64512 Len=0 MSS=1460
22 49:56.2 192.168.11.102 192.168.11.100 TCP 60 49250 > 20 [ACK] Seq=1 Ack=1 Win=4096 Len=0
23 49:56.2 192.168.11.102 192.168.11.100 FTP 103 Request: STOR 20240919_111530.jpg.tmp
24 49:56.2 192.168.11.100 192.168.11.102 FTP 108 Response: 150 File status okay; about to open data connection.
25 49:56.2 192.168.11.102 192.168.11.100 FTP-DATA 1078 FTP Data: 1024 bytes (PASV) (STOR 20240919_111530.jpg.tmp)
: :
68 49:56.3 192.168.11.102 192.168.11.100 FTP-DATA 1078 FTP Data: 1024 bytes (PASV) (STOR 20240919_111530.jpg.tmp)
69 49:56.3 192.168.11.100 192.168.11.102 TCP 54 20 > 49250 [ACK] Seq=1 Ack=30721 Win=64512 Len=0
70 49:56.3 192.168.11.102 192.168.11.100 FTP-DATA 715 FTP Data: 661 bytes (PASV) (STOR 20240919_111530.jpg.tmp)
71 49:56.3 192.168.11.102 192.168.11.100 TCP 60 49250 > 20 [FIN, ACK] Seq=31382 Ack=1 Win=4096 Len=0
72 49:56.3 192.168.11.100 192.168.11.102 TCP 54 20 > 49250 [ACK] Seq=1 Ack=31383 Win=63851 Len=0
73 49:56.3 192.168.11.100 192.168.11.102 TCP 54 20 > 49250 [FIN, ACK] Seq=1 Ack=31383 Win=63851 Len=0
74 49:56.3 192.168.11.102 192.168.11.100 TCP 60 49250 > 20 [ACK] Seq=31383 Ack=2 Win=4095 Len=0
75 49:56.6 192.168.11.100 192.168.11.102 TCP 138 [TCP Retransmission] 21 > 49249 [PSH, ACK] Seq=245 Ack=159 Win=64354 Len=84
76 49:56.6 192.168.11.102 192.168.11.100 TCP 60 [TCP ACKed unseen segment] 49249 > 21 [ACK] Seq=159 Ack=329 Win=3768 Len=0
77 49:56.6 192.168.11.102 192.168.11.100 FTP 103 Request: RNFR 20240919_111530.jpg.tmp
78 49:56.6 192.168.11.100 192.168.11.102 FTP 110 Response: 350 Requested file action pending further information.
79 49:56.6 192.168.11.102 192.168.11.100 FTP 99 [TCP ACKed unseen segment] Request: RNTO 20240919_111530.jpg
80 49:56.6 192.168.11.100 192.168.11.102 FTP 62 Response: 250 Ok
81 49:56.6 192.168.11.102 192.168.11.100 FTP 60 [TCP ACKed unseen segment] Request: QUIT
82 49:56.6 192.168.11.100 192.168.11.102 FTP 68 Response: 221 Goodbye.
(Bulk of data transfer removed for brevity between lines 25 & 68)
The problem is the delay between lines 74 & 75 - might only be 300ms, but that adds up over 200+ files.
(Using Filezilla for the FTP server is about 3 times faster than using Indy.)
I initially noticed that after the final data packet (line 70 above) Indy wasn't responding with the expected 226 'Closing data connection.' , so I thought (I'm a FTP novice) that perhaps the device wasn't closing the data connection. So I hacked the ReadFromStream procedure in TIdFTPServer.DoDataChannelOperation() to exit if the packet size was under 1k. That resulted in Indy providing the 226 response:
74 07:48:43.986 192.168.11.102 192.168.11.100 FTP-DATA 940 FTP Data: 886 bytes (PASV) (STOR 20240129_074854.jpg.tmp)
75 07:48:43.986 192.168.11.102 192.168.11.100 TCP 60 49158 > 50499 [FIN, ACK] Seq=32631 Ack=1 Win=4096 Len=0
76 07:48:43.986 192.168.11.100 192.168.11.102 TCP 54 50499 > 49158 [ACK] Seq=1 Ack=32632 Win=64512 Len=0
77 07:48:43.990 192.168.11.100 192.168.11.102 TCP 54 50499 > 49158 [FIN, ACK] Seq=1 Ack=32632 Win=64512 Len=0
78 07:48:43.991 192.168.11.102 192.168.11.100 TCP 60 49158 > 50499 [ACK] Seq=32632 Ack=2 Win=4095 Len=0
79 07:48:44.160 192.168.11.100 192.168.11.102 TCP 108 [TCP Retransmission] 21 ? 49157 [PSH, ACK] Seq=247 Ack=159 Win=64354 Len=54
80 07:48:44.161 192.168.11.102 192.168.11.100 TCP 60 49157 > 21 [ACK] Seq=159 Ack=301 Win=3796 Len=0
81 07:48:44.445 192.168.11.100 192.168.11.102 FTP 84 Response: 226 Closing data connection.
82 07:48:44.445 192.168.11.102 192.168.11.100 FTP 103 Request: RNFR 20240129_074854.jpg.tmp
(Captures were taken on different dates so don't correspond exactly.)
But there's still a delay before the 226 response (line 81).
After a quick Google of 'FIN ACK' it seems that the device is to blame, as it shouldn't ?? be including the ACK as it has nothing to acknowledge.
So I'm thinking the unexpected ACK is throwing Indy off.
(For reference Filezilla's handling looks like so:
68 12:35:34.094 192.168.11.102 192.168.11.100 FTP-DATA 938 FTP Data: 884 bytes (PASV) (STOR 20240919_110108.jpg.tmp)
69 12:35:34.094 192.168.11.102 192.168.11.100 TCP 60 49206 > 50507 [FIN, ACK] Seq=30581 Ack=1 Win=4096 Len=0
70 12:35:34.094 192.168.11.100 192.168.11.102 TCP 54 50507 > 49206 [ACK] Seq=1 Ack=30582 Win=64512 Len=0
71 12:35:34.094 192.168.11.100 192.168.11.102 TCP 54 50507 > 49206 [FIN, ACK] Seq=1 Ack=30582 Win=64512 Len=0
72 12:35:34.094 192.168.11.100 192.168.11.102 FTP 80 Response: 226 Operation successful
73 12:35:34.095 192.168.11.102 192.168.11.100 TCP 60 49206 > 50507 [ACK] Seq=30582 Ack=2 Win=4095 Len=0
74 12:35:34.095 192.168.11.102 192.168.11.100 TCP 60 49205 > 21 [ACK] Seq=159 Ack=364 Win=3733 Len=0
75 12:35:34.095 192.168.11.102 192.168.11.100 FTP 103 Request: RNFR 20240919_110108.jpg.tmp
No delay, no TCP retransmission.)
Went hunting for Indy's FIN (and ACK) handling and came up empty (except for IdRawHeaders.pas and IdRawFunctions.pas which appear to not be referenced). Bit more Googling seems to show they are handled at a lower level than Indy. (But if that's the case how come Filezilla works???)
I welcome any and all suggestions as to how to resolve this, including any solutions that should have been blazingly obvious!
(But excluding 'Just use Filezilla' as we're currently doing precisely that, but it'd be nicer to use Indy integrated with our code.)
Thanks in advance for any replies,
Adam.
|
|
|
recent breaking change |
Posted by: iwuser - 01-24-2024, 08:02 PM - Forum: IntraWeb General Discussion
- Replies (3)
|
|
Just noticed that with the latest IW versions, in the spot in my code where I need to bump up session timeout mid-flight, it no longer works:
"SessionOptions.SessionTimeout is locked. Suggestion: Set in ServerController OnConfig event instead."
This suggestion does not work for me, because I typically set the timeout small up-front, in ServerController OnConfig event, but then later in this case I need to prompt the user and so I need to increase it. Or I could do it the other way around: make it long up-front and then shorten it later in all other cases.
Can it be restored back to how it was before, please?
|
|
|
|