I have a Thread currently listening to a port.
When some other threads sends signal I want to make it listen to other port (close current socket and open other socket on a different port).
How can I do this without interrupting the Thread and creating a new one? Did some search and did not found any way of signaling a Thread that is doing some other task.