0Pricing
Lua Academy · Lesson

Non-Blocking I/O with luasocket

Use luasocket in non-blocking mode integrated with a coroutine scheduler.

What Is luasocket?

luasocket is a Lua library providing TCP/UDP sockets, HTTP, FTP, and SMTP clients. By default it is blocking; non-blocking mode enables async I/O.

Installing luasocket

Install via LuaRocks: luarocks install luasocket. Require it in your script.

local socket = require("socket")
local tcp = socket.tcp()

All lessons in this course

  1. Building a Simple Event Loop
  2. Async/Await with Coroutines
  3. Promise-Like Patterns
  4. Non-Blocking I/O with luasocket
← Back to Lua Academy