{"id":15374203,"url":"https://github.com/moteus/lua-socket-async","last_synced_at":"2026-03-11T15:36:26.811Z","repository":{"id":15655831,"uuid":"18393181","full_name":"moteus/lua-socket-async","owner":"moteus","description":"Asyncronus wrapper around LuaSocket library","archived":false,"fork":false,"pushed_at":"2014-04-09T09:55:41.000Z","size":164,"stargazers_count":17,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-27T00:15:45.219Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","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/moteus.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":"2014-04-03T06:16:48.000Z","updated_at":"2021-04-21T11:39:28.000Z","dependencies_parsed_at":"2022-07-12T15:13:59.760Z","dependency_job_id":null,"html_url":"https://github.com/moteus/lua-socket-async","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/moteus/lua-socket-async","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moteus%2Flua-socket-async","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moteus%2Flua-socket-async/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moteus%2Flua-socket-async/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moteus%2Flua-socket-async/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moteus","download_url":"https://codeload.github.com/moteus/lua-socket-async/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moteus%2Flua-socket-async/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30386145,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T14:10:17.325Z","status":"ssl_error","status_checked_at":"2026-03-11T14:09:37.934Z","response_time":84,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":[],"created_at":"2024-10-01T13:57:41.622Z","updated_at":"2026-03-11T15:36:26.784Z","avatar_url":"https://github.com/moteus.png","language":"Lua","readme":"lua-socket-async\n================\n\nAsyncronus wrapper around LuaSocket library\n\nThe idea is taken from [lua-memcached](https://github.com/silentbicycle/lua-memcached)\n\n#API\n\n## tcp_client(idle)\n\nCreate tcp client socket.\n\n## udp_client(idle)\n\nCreate udp client socket.\n\n# Common Socket methods\n\n## local_host()\n\n## local_port()\n\n## remote_host()\n\n## remote_port()\n\n## set_timeout(value)\n\n## timeout()\n\n# TCP Socket methods\n\n## connect(timeout, host, port)\n\nConnect the socket to the specified host/port.\n\n## disconnect()\n\nDisconnect the socket.\n\n## bind(host, port)\n\nBinds the socket to the specified host/port.\n\n## send(timeout, msg [,i [,j]])\n\n## recv(timeout [,pattern])\n\n# UDP Socket methods\n\n## connect(host, port)\n\nSet peername for socket.\n\n## disconnect()\n\nClear peername on the socket.\n\n## bind(host, port)\n\nSet sockname on the socket.\n\n## send(timeout, msg [,i [,j]])\n\n## recv(timeout [,size])\n\n## sendto(timeout, msg, host, port)\n\n## recvfrom(timeout [,size])\n\n##Usage\n\n``` Lua\nlocal async_socket  = require \"async_socket\"\n\n-- \nlocal cnt = 0\nfunction idle() cnt = cnt + 1 end\n\nlocal cnn = async_socket.tcp_client(idle)\n\nlocal ok = assert(cnn:connect(nil, HOST, PORT))\n\nprint(\"CONNECT:\",cnt)\n\ncnn:send(5, MESSAGE)\n\nprint(\"SEND:\",cnt)\n\nMESSAGE = cnn:recv(5)\n\nprint(\"RECV:\", cnt)\n\ncnn:close()\n```\n\nUsing async socket with [lua-pop3](https://github.com/moteus/lua-pop3) library - [async_pop3.lua](/examples/async_pop3.lua)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoteus%2Flua-socket-async","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoteus%2Flua-socket-async","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoteus%2Flua-socket-async/lists"}