Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be 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