Fix client socket API bug.