Add the socketOnPacket delegate method for testing purpose