Unfortunately, I can't reproduce either of these on a fresh world; my simple three-computer network (one router, two clients) manages to set up fine.
I will say that routing tables have trouble populating if a router isn't the first computer set up, or if computers previously set up are not rebooted after the last one is set up. This is because only routers will automatically distribute their route table when a computer starts up, to avoid some serious lag issues in dense networks.
Imgoodisher, on 20 May 2012 - 03:13 PM, said:
I've been trying to make something with this, but its not working. for some reason the client won't send anything to the server. I'm pretty sure I have everything set up right, but its not very obvious how to set it up so I can't be sure I got everything. I have a client and server with
shell.run("modread")
shell.run("netd")
net.netInit()
in it, and a router with the same thing but with a shell.run("routed") before the net.netInit(). All the computers are labeled (server is labeled bankserver"), the server is running a daemon program that is pretty much the same thing as the one in the readme (name is account), but when I run connection.open("bankserver", "account", 2) it returns false. Why? did I miss something?
To help you troubleshoot this issue, I would like to see the route table (etc/hosts) on the router, the computer "bankserver" and the client attempting to connect to bankserver. Also, they are all inside rednet range, correct?
Here is a stripped-down network utility (programs/net) that allows you to view the route table or delete the route table (from memory and disk) on any computer:
local tArgs = { ... }
if tArgs[1] == "route" then
--routes stuff
if tArgs[2] == "print" then
for rId, rInfo in pairs(net.routeTable) do
print(rId..": "..rInfo.name.." ("..rInfo.gateway..":"..rInfo.cost..")")
end
elseif tArgs[2] == "flush" then
net.routeTable = {}
return net.netInit()
end
else
print("Usage: net route <print|flush>")
--print(" net shell <servername>")
end
tirankenja, on 20 May 2012 - 06:46 PM, said:
Not getting a connection for me seems to either being the server reusing an unclosed connection (the server in the readme seems to do that). Or if the /etc/hosts file not having the server in it. Provoking the latter to happen seems a bit random to me so far. But once it is there it seems to be working.
Edit:
So far I have been unable to get a connection over a router. So that could also be the problem
Re-using unclosed connections
generally hasn't caused any issues for me. I would be very interested to see it doing so. If there's anything you can send me to help reproduce the issue, I'd be very appreciative. Try the following in a new creative world (same as survival, but much faster for testing):
Create and label three computers. Set up one as a router and reboot it:
shell.run("modread")
shell.run("netd")
shell.run("routed")
net.netInit()
Then set up the other two as normal computers, and reboot them:
shell.run("modread")
shell.run("netd")
net.netInit()
If you have filed/filec installed, try running filed on one of the normal computers and running filec from the other. This should work. If so, try creating another computer just out of range of one normal computer, but in range of the router. Attempt a connection through the router this way.
To both; looking at the code, there is also an issue with an empty packet message. If a packet is sent with no message, it will break things due to the way packets are handled when being received. I'll look into adding a check for that, but the assumption that the packet message isn't empty is fairly common throughout the code.