{"id":16788589,"url":"https://github.com/mna/luasock99","last_synced_at":"2026-05-18T08:32:49.184Z","repository":{"id":145701747,"uuid":"283302376","full_name":"mna/luasock99","owner":"mna","description":"Lua module for the socket99 C library. (mirror)","archived":false,"fork":false,"pushed_at":"2020-07-28T19:03:54.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T00:41:28.921Z","etag":null,"topics":["lua","mirror","socket"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mna.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-28T19:01:28.000Z","updated_at":"2020-07-29T02:14:15.000Z","dependencies_parsed_at":"2023-04-07T23:46:59.574Z","dependency_job_id":null,"html_url":"https://github.com/mna/luasock99","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mna/luasock99","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mna%2Fluasock99","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mna%2Fluasock99/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mna%2Fluasock99/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mna%2Fluasock99/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mna","download_url":"https://codeload.github.com/mna/luasock99/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mna%2Fluasock99/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33170847,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T05:43:36.989Z","status":"ssl_error","status_checked_at":"2026-05-18T05:43:19.133Z","response_time":71,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["lua","mirror","socket"],"created_at":"2024-10-13T08:18:22.214Z","updated_at":"2026-05-18T08:32:49.179Z","avatar_url":"https://github.com/mna.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# luasock99\n\nA Lua module that exposes the [socket99] C library in Lua, making it easier to create TCP/UDP/Unix Domain client and server sockets.\n\n* Canonical repository: https://git.sr.ht/~mna/luasock99\n* Issue tracker: https://todo.sr.ht/~mna/luasock99\n\n## Install\n\nVia Luarocks:\n\n```\n$ luarocks install luasock99\n```\n\n## API\n\nAssuming `local sock99 = require 'sock99'`. You can check out the tests for actual examples of using the API.\n\n### `open(t)`\n\nOpen the socket as configured by table t, which may have the following fields:\n* host (string): the hostname to connect to, for TCP/UDP sockets.\n* port (integer): the port number to connect to, for TCP/UDP sockets.\n* path (string): the Unix Domain socket path.\n* ipv4 (string): IPv4 address, if host and path are missing.\n* ipv6 (string): IPv6 address, instead of using host.\n* server (bool): set to true to create a server socket (i.e. `listen` instead of `connect`).\n* datagram (bool): set to true for datagram socket instead of stream.\n* nonblocking (bool): set to true for a non-blocking socket.\n* backlog (integer): the size of the backlog, for server socket.\nTODO: add support for sockopts\n\nIt returns the file descriptor (integer) on success, or `nil` followed by a system-specific error message and error code on error. The file descriptor can be used with the standard POSIX calls (e.g. with `luaposix`: `posix.unistd.close`, `posix.sys.socket.send`, etc.).\n\nNote that this is a raw integer, as such it cannot install a garbage collector finalizer to close itself - it must be closed explicitly.\n\nTODO: for Lua 5.4, set a metatable with `__close` method.\n\n## Development\n\nClone the project and install the required development dependencies:\n\n* luaunit (unit test runner)\n* luaposix (for tests)\n\nIf like me you prefer to keep your dependencies locally, per-project, then I recommend using my [llrocks] wrapper of the `luarocks` cli, which by default uses a local `lua_modules/` tree.\n\n```\n$ llrocks install ...\n```\n\nTo run tests:\n\n```\n$ llrocks run test/*.lua\n```\n\n## License\n\nThe [BSD 3-clause][bsd] license for the Lua module. For the `socket99` C library, see the `deps/socket99/socket99.c` header.\n\n[bsd]: http://opensource.org/licenses/BSD-3-Clause\n[llrocks]: https://git.sr.ht/~mna/llrocks\n[socket99]: https://github.com/silentbicycle/socket99\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmna%2Fluasock99","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmna%2Fluasock99","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmna%2Fluasock99/lists"}