MightyPirates / OpenComputers

Home of the OpenComputers mod for Minecraft.
https://oc.cil.li
Other
1.6k stars 434 forks source link

Server rack not passing packets correctly #692

Closed magik6k closed 10 years ago

magik6k commented 10 years ago

The external mode seems to work good(according to http://ocdoc.cil.li/block:server_rack?redirect=1), But when two servers in server rack try to send/broadcast a message betwen them and sender is not connected to any side, then message is dropped, rather than being sent to other servers in rack. If server D sends a message, it is sent to all other servers in the rack. - last line of ocdoc article

Kubuxu commented 10 years ago

Are you sure that rack was in internal mode?

fnuecke commented 10 years ago

Quoting relevant parts from the wiki:

Servers A, B and C are connected to the left, right and back faces of the server, respectively, D is not connected to any face. In External mode, [...] If server D sends a message, no-one will get it, because it isn't connected. In Internal mode, [...] If server D sends a message, it is sent to all other servers in the rack.

Remembering the conversation on IRC correctly, you expect servers to also be able to communicate with each other while in external mode, even when disconnected? In that case I'd consider this more of a feature request than a malfunction. The reason I'm not too fond of the change is that it removes a potential configuration - servers being completely disconnected - whereas now you could just connect a server to an otherwise unused face to have messages forwarded to it?

magik6k commented 10 years ago

@fnuecke The issue is about internal mode -> assuming wiki design - In internal mode if server A sends message, B,C,D servers will get it - thats OK, but when server D will try to send/broadcast(actually tested only bcasts because UUID simplicity), no one gets that message, and I assume that A,B,C should get it.

Test programs: sender: nettest.lua / pastebin get DmF3J5RR

    local component = require "component"
    local modem = component.modem
    while true do
      print("S")
      os.sleep(0.7)
      modem.broadcast(1,"abc")
      print "BC"
    end

receiver: eventview.lua / pastebin get vWatKYpn

    local event = require "event"
    require ("component").modem.open(1)

    while true do
        local e = {event.pull()}
        if e[1] then
            print("Event: ", table.unpack(e))
        end
    end
fnuecke commented 10 years ago

Ah, if it doesn't work even in internal mode that's indeed a bug then. I'll look into it, thanks!