ffi = require 'ffi'
AF_INET = 2
SOCK_STREAM = 1
ffi.load("Ws2_32.dll") -- DLL with net functions
ffi.cdef[[
int __stdcall socket(int family, int type, int protocol);
]]
local sd = ffi.C.socket(AF_INET, SOCK_STREAM, 0)
-- do bind, listen, accept and transfer data