Add state_goto in sock.py