Forum > Networking and Web Programming

[Solved] Lazarus 2.2.4, Indy 10 (latest), OSX Ventura 13.4 on an M1 iMac

(1/4) > >>

JimKueneman:
I have a component set I created for my use.  I converted to Indy because Synapse was not working in 64 Bit OSX and did not look like it was very active.  I did this late last year on this M1 Mac and I swear it was working back then.  I am trying to work on this project again and I can't get TCP clients to get to the TCP server running on the M1. 

If I run the client on the M1 OSX (same IP) then I can connect no problem with clients that come from various sources including an Indy based one.  If I run the client from a VMWare operating system (different IP address but on the same local domain) or from an iPhone on the local domain with a Delphi app I wrote and a Swift app from a friend it never detects a connection.  I have turned the firewall off as well as select the app for incoming with it on. 

I can run a different server application for this port (it was written in Java) and I can connect no problem from the iOS apps and the VMWare other OS clients so it does not seem like it is an underlying firewall issue as I did not add that application to the firewall list and it worked.

When I look in WireShark I can see the first connection frame coming from all these client apps but my Lazarus/Indy app never responds at all.

I swear this was working last fall with the VMWare clients and the iOS apps but it is not now.  It is driving me nuts...  I also wrote a simple program in Lazarus creating a IdTCPServer (eliminating all my higher level wrappers in my components) and that will not connect with anything but a server running on the same IP address.

Does anyone have any idea where to look?
Jim

JimKueneman:
So I compiled the simple app in Delphi and compiled for M1 and ran it in OSX.  When trying to connect it threw a ton of exceptions and never connected.  I now recall trying to get it to work on a Raspberry Pi and I could not get the server to work either so I am starting to think there is something not quite right with the ARM code in Indy (there are a number of ARM only conditional defines I stepped through in Delphi)

Remy Lebeau:
I don't know what to tell you.  Indy uses standard Posix socket functions, and doesn't do anything special for M1, so it should work, I think.  You will just have to debug into Indy's code to see where the failure is actually happening.

JimKueneman:

--- Quote from: Remy Lebeau on July 16, 2023, 08:12:13 pm ---I don't know what to tell you.  Indy uses standard Posix socket functions, and doesn't do anything special for M1, so it should work, I think.  You will just have to debug into Indy's code to see where the failure is actually happening.

--- End quote ---

Spent a few hours digging around trying to figure it out.  So I found a couple things

1) I was using a bad example from somewhere and I was creating 2 bindings instead of one for the listener....

What I am doing now


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---   IdSocketHandle := IdTCPServer.Bindings.Add;   IdSocketHandle.Port := 12021;   IdSocketHandle.IP := (ConnectionInfo as TLccEthernetConnectionInfo).ListenerIP;    
What I was doing based on an example from somewhere..


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---   IdTCPServer.Bindings.Add.Port := 12021;   IdTCPServer.Bindings.Add.IP := (ConnectionInfo as TLccEthernetConnectionInfo).ListenerIP;    
So connection was made when the client was local on the correct Port but the IP was zero

Then I forgot last fall about this:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TIdThread.Cleanup;var  LScheduler: TIdScheduler;  LList: TIdYarnList;begin  Exclude(FOptions, itoReqCleanup);   // RLebeau 9/20/2019: there is a race condition here with TIdScheduler.TerminateAllYarns().  // Notify TIdScheduler of the Yarn being freed here, otherwise, a double free of the Yarn  // can happen if TIdThread.Cleanup() and TIdSchedulerOfThread.TerminateYarn() try to destroy  // the Yarn at the same time.  TerminateYarn() destroys the Yarn inside the ActiveYarns lock,  // so the destroy here needs to be done inside of the same lock...   //IdDisposeAndNil(FYarn);  if FYarn is TIdYarnOfThread then  begin    LScheduler := TIdYarnOfThreadAccess(FYarn).FScheduler;  << If you don't have checking off this throws and exception....    if Assigned(LScheduler) then    begin      LList := LScheduler.ActiveYarns.LockList;      try        // if the Yarn is still in the list, remove and destroy it now.        // If not, assume TIdScheduler has already done so ...        if LList.Remove(FYarn) <> -1 then begin          IdDisposeAndNil(FYarn);        end;      finally        LScheduler.ActiveYarns.UnlockList;      end;    end;  
Is there anyway to do something to the code to allow procedure checking to be enabled?

I had high hopes after finding this as now I had only one binding with the right IP and Port but no joy... 

The Select function is called with the correct binding handle but it never returns that it was triggered when I try to connect from some other local IP address...

Jim

JimKueneman:
Can anyone take a look at this and tell me if I am doing something wrong... simple server application.   If you change the path to your Indy install folders you can run it.  I don't install the packages I always dynamically create components.

Thanks
Jim

Navigation

[0] Message Index

[#] Next page

Go to full version