use pickle instead of json

use pickle instead of json, match the server rewrite with python3,
socket communicating is more reliable.