socket and command callback