Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Mihini/socket

SOCKET

TCP example:- Variables

local sched = require 'sched'
local socket = require 'socket'

Main function

local function main()
  local tcpSocket= socket.bind("ip-address",8090)
    while true do
       data=tcpSocket:receive('*a')
       print(data)
    end
end

UDP Socket

Variables

local sched = require 'sched'
local socket = require 'socket'

Main function

local function main()
  local tcpSocket= socket.bind("ip-address",8090)
   while true do
     data=tcpSocket:receive('*a')
     print(data)
  end
end

Back to the top