I have an application that calls connect() in a subroutine A. This sub-routine A is called when a button A is pressed.
After connection has established, user can choose to click button B. This button B has to be programmed as a separate sub-routine. However, I need TCP connection to run sub-routine B.
After connect() is called in sub-routine A, sub-routine A is exit. The connection is closed as well during exit.
Is there any way to keep this connection after connected even sub-routine A is exit?
Many thanks!