

Eric Bonilha
Members-
Content Count
27 -
Joined
-
Last visited
Everything posted by Eric Bonilha
-
Hello! I'm trying to diagnose an issue I have with our application and would like to pick the minds of the experts here. The application has a TCP Server running on the main thread, so all connections are processed by the main thread and basically the issue I'm having is that if the main thread is somewhat busy (not even too busy), some connections are straight away refused by the OS (When clients try to access the application). Now, we have this application running in thousands and thousands of machines and this is a VERY RARE occurrence... as even if the main thread is busy (processing something else) when an inbound connection is pending, the OS should keep this connection in a backlog and the effect is that the client trying to access might take some time to get a reply, but it will establish the connection as soon as the thread accepts the connection, and I believe this is the standard way that the OS works, please correct me if I'm wrong... I don't know why, in some very rare cases (like this one), if the thread is slightly busy, many connections will be straightly refused... Do you have any idea why? Could this be some setting on the OS? This is Windows Server (I have to remotely access the customer to get the specific version). I tried increasing the ListenBacklog value to high values like 200 (instead of the default 15), but still the problem persists, in the latest tests I did, I could see about 14 or 15 connections being accepted and processed, then all other connections (We were opening about 80 connections simultaneously) are immediately refused. Any ideas or suggestions are appreciated! Thanks Eric
-
Connection refused issue
Eric Bonilha replied to Eric Bonilha's topic in ICS - Internet Component Suite
Thanks for all the answers! I will check on the firewall settings, but the test was done locally, so the client (Basically a camera surveillance system) running on the same machine as the server, connecting local, so I'm not sure the firewall would affect it Here are more thoughts: Remy: My initial suspicious was the backlog, the connection was reaching the backlog (because the thread is busy and has not yet accepted all connections), but I did set a value of 200 for the backlog (instead of 15) and it didn't help. I checked and debugged the code and I confirmed that the ICS is sending the property value (200) to the windows API instead of 15 In our application, the connection is not being rejected when we receive the connection available event from ICS, I'm not sure ICS could be rejecting when it receives it, before actually triggering the event to us? I will check ICS source code Kas: The DDOS protection could be something to check, its a Windows Server (not client), but I will check if there is anything activated, this could be one reason indeed! Angus, Piette: The application keeps running normally, and the connections are accepted again after a few seconds. So basically, when the main thread has processed everything, new connections are accepted. Now I'm thinking about DDOS protection and I have to do some testing to see if it could be it or if its because the main thread is busy. As I said, we have this running on thousands of systems, and even when the main thread is busy, new connections will be "pending" waiting for the thread to accept them, and not straight away denied like its happening. So what I noticed is that if I open like 80 clients at the same time, only a few gets through (about 15), but then a couple of seconds later, when those failed connections are retried, they will get accepted! -
Hello ICS Socket currently has a property called BufferedByteCount which provides the amount of bytes that are still buffered to be sent via the socket. This property is particularly useful for us.. But if the socket is an SSL socket, this property doesn't work because the data is added to a different buffer for sending. In my source code I added a new property SslBufferedByteCount which is linked to the SSL buffer to sending data. I would like to ask the authors here if they would add a property like this to the official source, so we don't have to keep modifying the sources every time there is a new release Thanks Eric
-
Hello all I got a strange problem with our app.. We use ShowModal (That is supposedly supported by iOS, but even for Android, internally it will use Show because its not supported) to display a form and this has always worked.. Many customers now reported our app will crash on iPhone 12 and 13 with iOS 15.. After debugging I found that ShowModal will hang / crash the app, but ONLY on iPhone 12 and iPhone 13 with IOS 15.. If I try on iPhone 11 or 7 for example using iOS 15 (same version, I tried on 15.0.2 and 15.1) it works fine.. Only crashes on iPhone 12 and 13 Did any of you encounter such issue as well? I solved by not using ShowModal, but only Show,
-
Hello Sorry if this is a stupid question, but I was wondering, when using Firemonkey 3d objects in a scene, what is the measurement unit of object positions and dimensions? I see for example, I can create a TPlane and set a width of 10 and height of 10, but that doesn't mean anything for me if it doesn't translate to a real measurement unit like meters? In my case, I want to create a plane (lets say, a floor) that is 10x10 meters (in real world measurements) and place a camera object that is 4.5 meters high. How would I translate this measurement unit to whatever unit FMX 3d uses? Thanks
-
Thank you very much Indeed, if I consider everything as meters it works like a charm, exactly how I needed Thank you very much for the explanation
-
No exception handling with server crash
Eric Bonilha replied to Angus Robertson's topic in ICS - Internet Component Suite
@Kas Ob. I have been using EurekaLog and unfortunately this error is never caught, maybe because its external, but even when selecting Catch Handled Exceptions is selected, it also doesn't work. I didn't try "Handle every SafeCall exception" but in the help file they say this option doesn't do anything if Catch Handled Exceptions is selected. In my debugs session, it looks like it could be related to my multi-threading approach that might be wrong and while it works fine when no SSL is being used, looks like the SSL library does't like it and we might be doing some operation on the socket coming from different thread contexts -
No exception handling with server crash
Eric Bonilha replied to Angus Robertson's topic in ICS - Internet Component Suite
@Angus Robertson did you find a solution for this issue? I'm having the absolute same problem with my application, using OpenSSL DLL and ICS Server @FPiette In our case, the application will randomly crash with Exception code: 0xc0000374 which is a Heap Corruption. We are having this issue for years and we could never find the source of it.. We are intensively debugging for the past few days and what I could find is that the problem doesn't seem to happen if sockets are all running single-threaded, but once we have a multi-threading scenario, thats when this error starts happening.. but there is no simple way to reproduce the error as its not deterministic, its very random. This error happens on the server side (Its an ICS TCP server running our custom protocol). -
Hello We are using ICS 8.68 (I just saw that its old now...) and we have encountered a problem with OpenSSL that is hanging the thread where its running (In this case, the main thread). I'm not sure if this is something that was already fixed in newer versions, but it looks like it hangs inside the OpenSSL library I was able to catch it with EurekaLog (image attached). Does anyone have any idea if this can still happen? Looks like this happened when the client connection was already broken (This is on SERVER SIDE) and the server tried to send a packet and ICS closed the connection on the server side after identifying it was already dead Thanks
-
Thank you for all the answers, we will give it a try with ICS 9 and we will also check WER if we can disable it and check the configurations. I will keep you updated with our testing, but you gave some very good insights
-
Hello For the past few days I've been struggling trying to get the new Firebase integration of Delphi 11 (that was added in 10.4) for IOS to work, for Push Notification. Embarcadero really does a very poor job of documentation and sample code.. I'm impossible that they developed and never tested if this works... All the sample codes I found on the internet refer to the use of KastriFree library for FCM for IOS on Delphi, but supposedly, FCM for IOS support was added natively... and I would like to use the native implementation from Delphi instead of the third party library. I believe I have done all steps necessary (There are so many) Basically the iOS application is compiling with FCM successfully and it is starting as I can retrieve the phone Token, that is used to send the notification to.. but when I send notification on Firebase its never received by the phone, not even the test message from Firebase console... My firebase account is correctly linked to APNS using the APNS Key from apple Is there any tutorial on how to use Firebase Push Notification with iOS for Delphi 11 using the NATIVE implementation found on the new unit FMX.PushNotification.FCM.iOS ??
-
Hello I have a current issue with our app that is not working properly with iOS 15 and iPhone 12 and 13 (Any other works fine)... So, I updated my tools and the phone I use for development. I'm using XCode 13.1 and Delphi 11 with the latest patch from today applied and an iPhone 7 with iOS 15.1 I'm trying to deploy a BLANK application for testing the new tools and while the compilation and deployment works, as soon as the app runs, it crashes (blank, empty form). When debugging, I got an Error 6 while app is initializing. "Project1 raised exception class 6" This problem happens both with Delphi 10.4.2 and Delphi 11... Is it because of the new iOS 15? Have you guys had this issue already? iOS 15.1 was just released today and I couldn't update my development phone to 15.0.2 that is what my customers complained about, so I had to update to 15.1
-
I was able to receive a push notification, but I had to change this line on FMX.PushNotification.FCM.iOS: procedure TFcmPushService.RequestAuthorizationWithOptionsCompletionHandler(granted: Boolean; error: NSError); begin // if not TiOSHelper.SharedApplication.isRegisteredForRemoteNotifications then TiOSHelper.SharedApplication.registerForRemoteNotifications; end; I had to comment out the line "if not TiOSHelper.SharedApplication.isRegisteredForRemoteNotifications then" Not sure why.. but it was not calling registerForRemoteNotifications ever
-
That problem I solved, the entitlements was missing: <key>aps-environment</key> <string>development</string> but still, FCM loads with no errors now, but no messages are received.. god...
-
Looks like Firebase is failing to initialize with this message: 'no valid “aps-environment” entitlement string found for application' I have selected remote-notification on UIBackgroundModes My provisioning certificate does have Push Notification selected... I don't know what to do
-
ShowModal hang/crashes on iOS 15 with iPhone 12 / 13
Eric Bonilha replied to Eric Bonilha's topic in FMX
Thanks Dave. I don't have an iPhone 12 or 13 to test, I was relying on my customers phones (doing testflights) to try to fix the issue It will be interesting to understand why ShowModal only doesn't work on iPhone 12 and 13, while previous like 11 will work just fine with the same OS version -
Hello I will help you with one of your questions for Monterey I had a huge issue that I needed to recompile my app but I couldn't use XCode 13 on Catalina, so I updated to Monterey and then used XCode 13 (and 13.1 as well for testing) and all deployed applications were crashing... I has to format my mac to original OS, then install Big Sur manually from USB and use XCode 13.0 I would not recommend updating to Monterey. But, I was using Delphi 11. But I tried Delphi 10.4.2 on Monterey with XCode 13 and it gave the same results, the app compiled and deployed but was crashing when starting.. So I guess Monterey is really not supported. Delphi 10.4.2 supports Big Sur as well, so I would update to Big Sur instead of Monterey, then you can use XCode 13
-
Already found out my provisioning profile was expired
-
KenR I'm having the same issue with error 0x e8008015: A valid provisioning profile for this executable was not found. How did you solve it?
-
Its working now... I had to format my Mac and install Big Sur manually (I was using Monterey).. then I installed XCode 13.0 and now the application works fine
-
Dave, thanks... something I didn't mention is that I had to upgrade to Monterey and apparently its not supported by Delphi... I couldn't update to XCode 13 on Catalina, and couldn't upgrade directly to Big Sur, but I found out that I can upgrade manually.. so, I'm formatting my Mac again with original Catalina, then I will upgrade manually to Big Sur and try again..
-
KenR, so when you build a blank application and deploy to iOS 15 with XCode 13 from Delphi 11, it crashes as well and doesn't run?
-
Same results with iPhone 11... the blank app just crahes when opening.. in fact I can't even debug it because it crashes before Application.Initialize is even called
-
I got the same results with XCode 13.0... Blank application is compiled, deployed to the phone, but it crashes when it opens.. I will try on another iphone now
-
Ken, I'm using XCode 13.1 Everything in the compilation and deployment goes smooth but when running the application it crashes Dave, Maybe it could be the XCode, but I don't know if I can downgrade to 13.0 from 13.1 as I'm using XCode 13.1 because that is what was available to me.. I noticed that the apps that were previously compiled works on iOS 15.1 but if I try to make a new app, blank form, with this toolchain (Delphi 11, XCode 13.1 for iOS 15.1 on iPhone 7) then the app crashes. I will try on another iPhone just in case and will try to downgrade XCode