Added 'closeInThread' in Server, made Server and Client final