You seem to be setting up the server each time through the loop, which is not efficient. You do not seem to be closing the server at the end of the loop, which is a problem.
Your code sample does not attempt to read from the client, so there is nothing there to interrupt.
See https://www.mathworks.com/matlabcentral/newsreader/view_thread/153485 for a discussion on how to time out.