fix second to milliseconds
thread for server socket & safe termination