so basically, im trying to create an automatic method that will simply detect if the current client is disconnected, and if so simply, reconnect it, and resume its current ongoing work, the part the im stuck at is how to "reconnect" part.
for starters, i wanted to make it safe, so i just said, well, lets close everything, and i disposed all sockets and aborted all threads, but then i could not reconnect the gateway socket, due to port exhustion, or simply could not connect to the same ip/port, also i couldnt create an entierly new thread and start a client from there, due to "thread state is running or terminated and it cannot restart", well, it seems that im missing something, its a simple task, but im having hard time accomplishing that, glad if someone would help
p.s im trying to re-connect the same server machine obviously over and overc.






