This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Ping IP doesn't work
#1
Hello,

I am using this script: https://forum.logicmachine.net/showthread.php?tid=1035 to ping an IP adress of a laptop in the same network as the LM is. It somewhy does not work, I transformed script into this:

Code:
function socketping(ip, port, timeout)
  port = port or 80
  local sock = require('socket').tcp()
  sock:settimeout(timeout or 20)
  local res, err = sock:connect(ip, port)
  log(res)
  log(err)
  sock:close()
 
  return res, err
end


ip = '192.168.100.149'

if socketping(ip) then
  log('CONNECTED')
  grp.write('0/0/9', true)
else
  log('DISCONECTED')
end
But it always logs disconected, no matter what I try. If I ping the IP from cmd, it pings fine. Where could be the problem?

Thank You.
Reply


Messages In This Thread
Ping IP doesn't work - by MantasJ - 08.08.2019, 07:30
RE: Ping IP doesn't work - by Daniel - 08.08.2019, 07:49
RE: Ping IP doesn't work - by admin - 08.08.2019, 07:49
RE: Ping IP doesn't work - by MantasJ - 08.08.2019, 08:10
RE: Ping IP doesn't work - by Daniel - 08.08.2019, 08:19
RE: Ping IP doesn't work - by MantasJ - 08.08.2019, 08:34
RE: Ping IP doesn't work - by AlexLV - 22.04.2020, 21:23
RE: Ping IP doesn't work - by admin - 23.04.2020, 05:07
RE: Ping IP doesn't work - by AlexLV - 23.04.2020, 08:16
RE: Ping IP doesn't work - by djaval - 24.04.2024, 08:05
RE: Ping IP doesn't work - by admin - 24.04.2024, 08:47

Forum Jump: