Connection broken after 30 seconds

I am using Mbed Os 6.2 with Mbed Studio. When I execute a socket.connect() it only lasts for 30 seconds and then disconnects. I’ve tried both sending and receiving messages during this time, but it still disconnects. Is this how Mbed Os is supposed to work? If not, how do I get it to maintain the connection forever?

Thank you in advance,
Alfred Votolato
Andplus, Inc