{"id":16652421,"url":"https://github.com/pylover/meloop","last_synced_at":"2025-06-17T08:40:49.789Z","repository":{"id":44377132,"uuid":"512328727","full_name":"pylover/meloop","owner":"pylover","description":"Monadic event loop for C using epoll.","archived":false,"fork":false,"pushed_at":"2022-09-01T10:04:15.000Z","size":382,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T18:05:45.626Z","etag":null,"topics":["c","epoll","epoll-tcp-server","io","monads"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pylover.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-10T02:39:39.000Z","updated_at":"2023-06-26T12:50:33.000Z","dependencies_parsed_at":"2023-01-17T17:15:30.769Z","dependency_job_id":null,"html_url":"https://github.com/pylover/meloop","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pylover/meloop","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pylover%2Fmeloop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pylover%2Fmeloop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pylover%2Fmeloop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pylover%2Fmeloop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pylover","download_url":"https://codeload.github.com/pylover/meloop/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pylover%2Fmeloop/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260325078,"owners_count":22992314,"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":["c","epoll","epoll-tcp-server","io","monads"],"created_at":"2024-10-12T09:28:36.052Z","updated_at":"2025-06-17T08:40:49.739Z","avatar_url":"https://github.com/pylover.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# meloop (Monadic Event Loop)\n\n\n## Features\n\n- Async/non-blocking IO\n- IO: read, write, wait(using epoll)\n- TCP client: connectA\n- TCP server: listenA, acceptA\n- SSL/TLS: tlsA, tlsreadA, tlswriteA\n- Timer using linux timerfd: timeropenA, timersleepA\n- Random using /dev/urandom: randopenA, randreadA, randencA\n\n## Build\n\n\n### Dependencies\n\n```bash\nsudo apt install build-essential pkgconf openssl\n```\n\n\n```bash\nmake clean\nmake all\nmake clean all\n```\n\n## Examples\n\nTake a look at `examples` directory.\n\n```bash\ncd examples\n\nmake echoshell\n./echoshell\n\n\nmake echoserver\n./echoserver\n\n\nmake echoclient\n./echoclient\n\n\nmake tlsclient\n./tlsclient\n\n\nmake random\n./random\n\n\nmake state\n./state\n```\n\n\n## Running Tests\n\n```bash\ncd tests\nmake clean runall\n```\n\n## Profiling\n\n\n### gprof\n\nRun desired example, signal it with `CTRL+C`, then:\n\n```bash\ncd examples\n\nmake echoserver\n./echoserver\n\ngprof echoserver\n```\n\n### valgrind\n\n```bash\nsudo apt install valgrind\n\ncd examples\nmake clean all \nmake valgrind\n```\n\nOr\n\n```bash\nvalgrind --tool=memcheck --leak-check=full ./echoserver\nvalgrind --tool=massif ./echoserver \n```\n\nExample output\n\n```bash\n==56319== Memcheck, a memory error detector\n==56319== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.\n==56319== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info\n==56319== Command: ./echoserver\n==56319==\n127.0.0.1:42658 Connected.\n127.0.0.1:42658 Disconnected.\n^C\nSIGINT detected: 2\nTerminating TCP Server\n==56319==\n==56319== HEAP SUMMARY:\n==56319==     in use at exit: 0 bytes in 0 blocks\n==56319==   total heap usage: 14 allocs, 14 frees, 2,384 bytes allocated\n==56319==\n==56319== All heap blocks were freed -- no leaks are possible\n==56319==\n==56319== For lists of detected and suppressed errors, rerun with: -s\n==56319== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)\n```\n\n\n## Coding Convention\n\n- C Macros: UPPER_CASE\n- Monads/Arrows: fooA\n- All others: lowercase with `meloop_` prefix.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpylover%2Fmeloop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpylover%2Fmeloop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpylover%2Fmeloop/lists"}