first draft finished. TODO: 1.non-block socket solution; 2. more extra infos;