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.

Copas - TCP status and Control
#6
Thanks, I can start and stop the Daemon.

My previous code was a library and returned a table of functions, start_server, stop_server, add_client, Remove_client etc which could be called.
When i start the library using the apps.daemon handler, the library runs but then im not sure how to access the fuctions. Can they be called from other scripts? or do i need to adjust the code so the event listener starts when the daemon runs and then use event messages to trigger functions within? or restructure another way?

My resident script looked like this:

local NetworkModule = require("user.CNI_Comms")

-- Start the Copas loop, event listener
NetworkModuleConfusedtart_server()

-- Add clients using the NetworkModule:add_client method
local client1 = NetworkModule:add_client("x.x.x.x", port)
local client2 = NetworkModule:add_client("x.x.x.x", port)
Reply


Messages In This Thread
Copas - TCP status and Control - by Diggerz - 17.05.2024, 22:08
RE: Copas - TCP status and Control - by admin - 20.05.2024, 07:24
RE: Copas - TCP status and Control - by admin - 15.07.2024, 06:30
RE: Copas - TCP status and Control - by Diggerz - 15.07.2024, 10:33
RE: Copas - TCP status and Control - by admin - 15.07.2024, 10:57

Forum Jump: