Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dofile("core")
- local function server()
- local sock = socket_create(AF_INET, SOCK_DGRAM, 0)
- if not sock:bind(inet_aton('212.201.26.99'), 80) then
- perror('bind() failed')
- end
- sock:listen()
- print('Listening on ' .. inet_ntoa(sock:getip()) .. ':80')
- while true do
- local peer = {}
- local buffer = sock:recv_from(peer)
- print('[' .. inet_ntoa(peer.network_address) .. ':' .. tostring(peer.transport_address) .. '] ' .. buffer)
- end
- sock:close()
- end
- setup_kernel()
- if not ifconfig('wlan0', '212.201.26.99') then
- perror('ifconfig() failed')
- end
- process_create_named(server, 'server')
- dumpif()
- sched()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement