{"id":24926831,"url":"https://github.com/jaytwolab/qping","last_synced_at":"2025-07-18T10:09:29.119Z","repository":{"id":96143196,"uuid":"135826919","full_name":"JayTwoLab/QPing","owner":"JayTwoLab","description":"Ping class for Qt 5 or 6 (without user elevation) :kr: Qt 5 또는 6 기반 계정 상승 필요없는 핑","archived":false,"fork":false,"pushed_at":"2023-03-29T04:50:11.000Z","size":58,"stargazers_count":20,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-05T04:41:45.150Z","etag":null,"topics":["cpp","languages","ping","qt","qt5","qt6"],"latest_commit_sha":null,"homepage":"https://jaytwolab.github.io/QPing/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JayTwoLab.png","metadata":{"files":{"readme":"README.ko.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":"j2doll","open_collective":null,"ko_fi":null,"tidelift":null,"custom":"https://www.buymeacoffee.com/Yukrf5X"}},"created_at":"2018-06-02T14:58:26.000Z","updated_at":"2025-05-19T02:50:38.000Z","dependencies_parsed_at":"2023-05-01T10:32:27.973Z","dependency_job_id":null,"html_url":"https://github.com/JayTwoLab/QPing","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/JayTwoLab/QPing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JayTwoLab%2FQPing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JayTwoLab%2FQPing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JayTwoLab%2FQPing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JayTwoLab%2FQPing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JayTwoLab","download_url":"https://codeload.github.com/JayTwoLab/QPing/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JayTwoLab%2FQPing/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265738573,"owners_count":23820167,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","languages","ping","qt","qt5","qt6"],"created_at":"2025-02-02T12:53:27.221Z","updated_at":"2025-07-18T10:09:29.111Z","avatar_url":"https://github.com/JayTwoLab.png","language":"C++","readme":"﻿## QPing\n\n\u003e *Read this in other languages: [English](README.md), :kr: [한국어](README.ko.md)*\n\n![](markdown-data/qping.png)\n\n- Ping 클래스. Qt 5 또는 6\n\n- 이 클래스로 ping을 쏘고 응답을 확인할 수 있습니다.\n\n### 노트\n\n- ICMP 프로토콜을 사용하는 함수를 호출하지 않도록 구성하였습니다.\n\t- 저는 예전에 로소켓을 사용하는 유사한 클래스를 만든 적이 있습니다.\n\t- 하지만 그런 경우 사용자 계정의 권한 상승이 필요합니다. root, superuser, admin 등\n\n### 설정 방법\n\n- QPing.h, QPing.cpp 를 여러분의 프로젝트에 복사하세요.\n\n- 여러분의 Qt 프로젝트(*.pro)에 해당 소스 코드를 추가하세요.\n\n```qmake\nHEADERS += QPing.h\nSOURCES += QPing.cpp\n```\n\n- 클래스를 활용하는 소스 코드를 넣으세요. main.cpp를 참조하세요.\n\n```cpp\n#include \u003cQtGlobal\u003e\n#include \u003cQCoreApplication\u003e\n#include \u003cQProcess\u003e\n#include \u003cQtGlobal\u003e\n#include \u003cQDebug\u003e\n#include \u003cQFile\u003e\n#include \u003cQSettings\u003e\n#include \u003cQLocale\u003e\n\n#include \u003ciostream\u003e\n\n#include \"QPing.h\"\n\nint main(int argc, char *argv[])\n{\n    QCoreApplication a(argc, argv);\n\n    QString destIpAddress = \"192.168.200.254\";\n    if ( argc == 2 )\n    {\n        // You can use application first parameter\n        // For example) QPingSF 192.168.0.10\n        QString strArg = argv[1];\n        destIpAddress = strArg;\n    }\n\n    // Define your OS and OS language.\n    // See sample of *.ini for OS. (You can define your own INI file)\n    // Please suggest strings that can be set in various languages and operating systems.\n\n    QString iniFilePath;\n    QString localSystemName = QLocale::system().name();\n    /* Returns the language and country of this locale as a string of the form \"language_country\",\n     * where language is a lowercase, two-letter ISO 639 language code,\n     * and country is an uppercase, two- or three-letter ISO 3166 country code.\n    */\n    QString langaugeISO639 = localSystemName.left(2);\n\n#ifdef Q_OS_WIN\n\n    if ( langaugeISO639 == \"ko\" )\n    {\n        iniFilePath = \":/ping-config-win-kr.ini\"; // Windows, Korean\n    }\n\n    if ( langaugeISO639 == \"en\" )\n    {\n        iniFilePath = \":/ping-config-win-en.ini\"; // Windows, English\n    }\n\n    /* TODO:\n     * Create a new INI file for your native language, referencing an existing INI file.\n    */\n\n#endif\n\n#ifdef Q_OS_LINUX\n\n    if ( langaugeISO639 == \"en\" )\n    {\n        iniFilePath = \":/ping-config-linux-en.ini\"; // Linux, English\n    }\n\n    /* TODO:\n     * Create a new INI file for your native language, referencing an existing INI file.\n    */\n\n#endif\n\n#ifdef Q_OS_MAC\n\n    if ( langaugeISO639 == \"en\" ) // Mac, English\n    {\n        // iniFilePath = mac ini... I don't have a Mac, because I'm poor.\n    }\n\n    /* TODO:\n     * Create a new INI file for your native language, referencing an existing INI file.\n    */\n\n#endif\n\n    ////////////////////\n\n    QPing qp; // main class\n\n    qp.setIniFile( iniFilePath ); // set configuration file\n    if ( ! qp.loadIniFile() )\n    {\n        std::cout \u003c\u003c  \"[ERROR] Failed to load ini file\" \u003c\u003c std::endl;\n        return (-1);\n    }\n\n    // Ping!\n    QPing::pingResult result = qp.ping(destIpAddress);\n\n    switch( result )\n    {\n        case QPing::pingSuccess:\n            std::cout \u003c\u003c  \"[SUCCESS] Success to ping\" \u003c\u003c std::endl;\n        break;\n\n        case QPing::pingFailed:\n            std::cout \u003c\u003c  \"[FAILED] Failed to ping\" \u003c\u003c std::endl;\n        break;\n\n        case QPing::initFailed1: // \"success string is empty\"\n        case QPing::initFailed2: // \"failed string is empty\"\n            std::cout \u003c\u003c  \"[ERROR] Initialization is failed\" \u003c\u003c std::endl;\n        break;\n\n        case QPing::notFound: // something wrong\n            std::cout \u003c\u003c  \"[ERROR] Result is not found\" \u003c\u003c std::endl;\n        break;\n\n        default:\n            std::cout \u003c\u003c  \"[ERROR] Undefined result : \" \u003c\u003c ((quint32)result) \u003c\u003c std::endl;\n        break;\n    }\n\n    return 0;\n}\n```\n\n### 라이센스\n\n- QPing은 MIT 라이센스입니다. https://github.com/JayTwoLab/QPing\n\n### 문의\n\n- 이슈를 남겨 주세요. https://github.com/JayTwoLab/QPing/issues\n","funding_links":["https://patreon.com/j2doll","https://www.buymeacoffee.com/Yukrf5X"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaytwolab%2Fqping","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaytwolab%2Fqping","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaytwolab%2Fqping/lists"}