tpzker 4 Posted June 30, 2019 Share Posted June 30, 2019 This is a draft. Examples of software will be coded later. Concepts Socket: A file on the system which links two programs' communications. OC: Abbreviation for "OpenComputers" OS: Abbreviation for "Operating System" OpenOS: The stock OS for OC computers. Socket: a medium for communication between two or more programs Rationale To standardize any possible IPC implementations Basic Concepts Background programs (or daemons) can be started with a simple wrapper, such as this example code: thread.create(function() shell.execute(ENV, "/bin/daemon.lua") end) Programs can communicate with sockets through the signals defined in this document These signals can be created with "computer.pushSignal(name: string, [...])" They can be received with "event.pull([timeout: number], [name:string], ...)" or "event.listen(event: string, callback: function)", or on a low-level basis with "computer.pullSignal([timeout: number])" Signals oipc_sock_comms(socketID: string, <... (message)>) -- OIPC Socket Communications -- message must be of type nil, boolean, number, string, table (tables and other messages MUST NOT contain threads and functions due to the limitations of computer.pushSignal()) Notes Please note that OIPC will only work with OSes which pass signals to all subprocesses instead of simply consuming the signal on "computer.pullSignal", "event.pull", or similar functions to wait for/listen for signals. Molinko 1 Quote Link to post Share on other sites
tpzker 4 Posted November 24, 2019 Author Share Posted November 24, 2019 Updated 11/24/2019 to use signals instead of files as they can be more convenient and more portable Quote Link to post Share on other sites
tpzker 4 Posted March 29, 2020 Author Share Posted March 29, 2020 Updated 3/29/2020 to note about signal consumption Quote Link to post Share on other sites