EasyTCP socket problem under Windows EC2

I have 2 Xojo apps that communicate via an EasyTCP socket. The first is a Service app that listens for a connection from the second Desktop app. When Desktop app User initiates the connection the 2 apps start a “handshaking” process of sending several messages back and forth. The 2 apps may be on the same machine or different machines. In either case the Desktop app User enters the IP address of the machine running the Service along with the Port number the Service is listening on. This all works fine for hundreds of customers.

But I have one customer running a Windows instance on AWS EC2 that has a problem. If the Service app has been disconnected from the Desktop app for a long period of time (as much as 24 hours) then the 2 apps will connect OK but the handshaking messages do not seem to get through… It seems like something is blocking the data.

Both apps are running on the same EC2 instance… It does not matter if you use the IP address or “Localhost”… I have tried it on 2 different Windows EC2 instance and could not replicate the problem. If they restart the Service app then the handshaking works fine again…

I cannot find any reference in Windows and EC2 documentation that might explain the problem… like maybe idle listening Ports get blocked after some period of time.

Any ideas on how to solve this are appreciated.

My guess would be that there’s a restriction as to how long a port can remain open with no activity. With the EC2 instances being all virtual, it wouldn’t surprise me if there were a mechanism to try to save resources as they are always so precious on those types of machines.

Just out of curiosity, do either of the apps run as services?

Scratch that. I see that it is

Ok, so… are you using an installer for the service app? If so, have you defined firewall requirements?

Greg thanks for the response.

No I do not have an installer and I do not define any firewall requirements…

But keep in mind that it works most of the time. It only fails after a long period of inactivity… and I cannot find any documented settings in Windows or EC2 that block a port after a certain amount of inactivity.

Also, I was unable to replicate the problem using 2 other EC2 instances…

I have asked the customer to try a different Port… but am not hopeful that will work.

Out of curiosity, what port did they use?

Port 50505

Well that blows that theory. I was thinking they’d used one of the <1024 privileged ports.