{"id":17242893,"url":"https://github.com/imcuttle/c_cpp-node_c_cpp_addon","last_synced_at":"2025-03-26T03:44:40.661Z","repository":{"id":45112994,"uuid":"70379948","full_name":"imcuttle/c_cpp-node_c_cpp_addon","owner":"imcuttle","description":"c/c++ \u0026 node c/c++ addon","archived":false,"fork":false,"pushed_at":"2022-01-07T14:34:11.000Z","size":4854,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T02:33:59.098Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imcuttle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-09T05:48:30.000Z","updated_at":"2016-10-09T05:49:05.000Z","dependencies_parsed_at":"2022-09-12T01:22:24.845Z","dependency_job_id":null,"html_url":"https://github.com/imcuttle/c_cpp-node_c_cpp_addon","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fc_cpp-node_c_cpp_addon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fc_cpp-node_c_cpp_addon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fc_cpp-node_c_cpp_addon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fc_cpp-node_c_cpp_addon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imcuttle","download_url":"https://codeload.github.com/imcuttle/c_cpp-node_c_cpp_addon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245585798,"owners_count":20639671,"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":[],"created_at":"2024-10-15T06:14:20.556Z","updated_at":"2025-03-26T03:44:40.643Z","avatar_url":"https://github.com/imcuttle.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# c/c++ \u0026 node c/c++ addon\n\n\n## directory tree\n\n```sh\n/\n├── build.sh            # build all cpp_src files by g++. (sh build.sh)\n├── cpp_src/\n│   ├── hostname.cpp    # get domain name's ip, command arguments [baidu.com]\n│   ├── client.cpp      # tcp client, command arguments [ip] [port]\n│   ├── client.h\n│   ├── iofuncs.cpp     # c standard lib about io\n│   ├── main.cpp        # test\n│   ├── printlist.cpp   # variable arguments \u0026 print format %s\n│   ├── server.cpp      # tcp server, command arguments [ip] [port]\n│   ├── server.h\n│   ├── command.h       \n│   ├── strfuncs.cpp    # c standard lib about string\n│   ├── sysio.cpp       # unix sys call about io\n│   ├── sysioflags.cpp  # unix sys call about io\n│   ├── shell.cpp       # c shell by unix sys call\n│   └── sysmmap.cpp     # unix sys call about mmap\n├── dir.sh              # get directory tree string (need node package `print-dir`)\n├── hellp               # `cpp_src/sysmmap.cpp` need this file.\n├── node_src/           # node files.\n│   ├── addon.cpp       # connect node \u0026 c/c++\n│   ├── binding.gyp     # config file\n│   ├── client.js\n│   ├── package.json\n│   └── server.js\n└── README.md\n\n4 directories, 26 files.\n```\n\n## have a look\n\n- tcp (sendfile \u0026 recvfile)\n\n![c tcp](imgs/up\u0026down.gif)\n\n- tcp (server \u0026 client)\n\n![c tcp](imgs/1.gif)\n\n- gethostbyname \n\n![c gethostbyname](imgs/2.gif)\n\n## get started\n\n1. tcp\n    - pure c/c++\n        ```sh\n        # clone this repo \u0026 after installed g++ on linux or mac.\n        sh build.sh\n    \n        ./server.out # run server\n    \n        # run client on another shell.\n        # after connected to server successfully\n        # you can input some string and type enter, that will be sent to server.\n        ./client.out\n        ```\n    \n    - node c/c++ addon\n        ```sh\n        # clone this repo \u0026 after installed node 6+ on linux or mac.\n        cd node_src\n        npm install\n        sudo npm install -g node-gyp\n        node-gyp rebuild\n    \n        node server.js  # run server\n    \n        # run client on another shell.\n        node client.out\n        ```\n\n2. c Shell\n\n    ```sh\n    sh build.sh  cpp_src/shell.cpp\n    ./mv.sh # sh mv.sh\n    \n    shell # anywhere\n    ```\n\n## More\n\n- [linux C book online](http://akaedu.github.io/book/ch37s02.html#id2904122)\n- [shell redirect \u0026 /dev/*](http://akaedu.github.io/book/ch28s06.html)\n- [v8 document](https://v8docs.nodesource.com/node-6.0/dc/d0a/classv8_1_1_value.html)\n- [node-addon-examples](https://github.com/nodejs/node-addon-examples/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimcuttle%2Fc_cpp-node_c_cpp_addon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimcuttle%2Fc_cpp-node_c_cpp_addon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimcuttle%2Fc_cpp-node_c_cpp_addon/lists"}