Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
  • 0
bufu1337

Screen sharing for multiple servers?

Question

I have a setup with about 12 Serverracks and in each 4 servers = 48 servers...
all connected to each other...
they need to be connected because they share a bunch of adapters...
now i dont want to have 48 screens, for each server one, that looks ugly?
i research a little bit, there is a thread API which can start a event.pull("modem_message") - listener in the background of a server without interfering other processes...
(https://oc.cil.li/index.php?/topic/1728-multi-threaded-send-and-receive/&page=0#comment-7937)


but i cant get anything it working correctly...
it already did not work with only 1 serverrack and 2 servers inside...
1 server even doesnt receive the message from the other one...

First server: (going to lua)

component.modem.open(123) ... returns true
_, _, _, _, _, m = event.pull("modem_message"); print(m)

Second Server: (going to lua)

component.modem.open(123) ... returns true
component.modem.broadcast(123, "test")

now i await that the first server receives the message but nope, nothing happens...

whats wrong with it?

i want to make it like: i have big screen, one server shows on this screen, i type in "change_screen server3" then he switches the source-server and the screen show the console of server3 instead of server1

(i am not good at explaining ;) and my english is bad i know)

can someone help me realize such a script... pleeeeeaaaaaasssse 

Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0
3 hours ago, payonel said:

you'll need to share all the code you are using in each side

i dont have much yet... step by step... but first step fails already:

First Server:

local thread = require("thread")
local c = require("component")
local event = require("event")
local m = component.modem
m.close()
m.open(123)
print("screenchange init")
thread.create(function()
    while true do
        print("a")
        os.sleep()
        print("port 123 open: " .. tostring(c.modem.isOpen(123)))
        _, _, _, _, _, message = event.pull("modem_message")
        print(message)
        --do next step
    end
end)
print("screenchange - thread started")

starting this...

then i go to the second server this script:

local c = require("component")
local m = component.modem
m.close()
m.open(123)
m.broadcast(123, "test")

nothing happens at the first server :(

 

 

 

EDIT: I solved the problem by myself... i forgot to connect the second line of both servers in the serverrack GUI... i didnt knew that it is for the network connection, was always wondering what it could be

trying to do the script on my own now... any help would be great... even if it is only fragments

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.