Changes getPacket logic to return synchronously