A
Abraham Khalil
Before user is about to close the gui, I want to free up the open
sockets used in my application. Now, we don't want to poll the exit,
waiting for the open sockets to finally free themselves and than the
application quits. The user is going to think something is wrong with
the application and wonder why its taking to long to exit
So, I thought of putting the close sockets in a thread and start it,
but the next line after starting a new thread in the main thread code
is System.exit. Now once that calls, the free sockets thread won't do
any work on closing the sockets, because the JVM is realease from its
resource. Now I'am damm if don't use a another thread,
or damm if using a thread (As it doesn't do anything).
Can I have a Thread as another JVM to free the sockets while the
application exit?
Thanks
sockets used in my application. Now, we don't want to poll the exit,
waiting for the open sockets to finally free themselves and than the
application quits. The user is going to think something is wrong with
the application and wonder why its taking to long to exit
So, I thought of putting the close sockets in a thread and start it,
but the next line after starting a new thread in the main thread code
is System.exit. Now once that calls, the free sockets thread won't do
any work on closing the sockets, because the JVM is realease from its
resource. Now I'am damm if don't use a another thread,
or damm if using a thread (As it doesn't do anything).
Can I have a Thread as another JVM to free the sockets while the
application exit?
Thanks