Link to home
Start Free TrialLog in
Avatar of Code_mechanic
Code_mechanic

asked on

Server thread manupulation

I m writing up a time server which communicates with clients via TCP/IP asynchronously.The listener itself runs on a thread spawned during initialisation. It listens on host at specified port for incoming connections and each client is served on a separate individual thread(i.e asynch op). The GUI allows the user to disconnect clients at any given time, and the way i do this is by closing all open connections, then closing the listening socket and finally aborting the thread the server is running on. Afterwards, I spawn a fresh thread to restart the server process. When i kill the thread, i do get exceptions thrown by the events that are already setup for the connected clients, but they are caught inside the code. Is this a good way of addressing the problem, are there standard/better ways of dealing with such a scenario?
would there be any examples i could refer to?
ASKER CERTIFIED SOLUTION
Avatar of gregoryyoung
gregoryyoung
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial