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

< Mihini
Revision as of 08:04, 11 March 2015 by Unnamed Poltroon (Talk) (Created page with "== SOCKET == '''TCP example:-''' '''Variables''' local sched = require 'sched' local socket = require 'socket' '''Main function''' local function main() local tcpSo...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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