Page 20 of 34

Re: LUBE (Networking Library) v0.6.1 + LUBE-X v0.02

Posted: Wed Dec 30, 2009 1:36 pm
by stampede
You need to test the clients thing (tcp + udp objects)? Did you add anything else you need to test? I can do it at night probably. Now I have to sleep a bit because of the last night's coding sprint :P

Re: LUBE (Networking Library) v0.6.1 + LUBE-X v0.02

Posted: Wed Dec 30, 2009 6:10 pm
by stampede
Hmm, the server still seems to hang up with tcp. I think it's about :acceptAll() function. Using that every two seconds in update function. Client seemed to conversate with the server smoothly, but server just didn't show any signs of doing anything. But after I disconnected client, the server showed lines it should show when client is connecting...

Should I use :acceptAll() in connection callback function? Didn't seem to work...

Re: LUBE (Networking Library) v0.6.1 + LUBE-X v0.02

Posted: Wed Dec 30, 2009 6:32 pm
by bartbes
No, acceptAll should be called directly before update, for best results.

Re: LUBE (Networking Library) v0.6.1 + LUBE-X v0.02

Posted: Wed Dec 30, 2009 6:43 pm
by stampede
If i just put acceptAll and then update (no timers or anything) server hangs up, and doesn't even show that someone's trying to connect BEFORE I close the client. Then it says "connection from 127.0.0.1"

Fuck this is hard, but fun :D

Re: LUBE (Networking Library) v0.6.1 + LUBE-X v0.02

Posted: Sun Jan 10, 2010 12:18 pm
by bartbes
Well, I decided to put my update up, which should finally have resolved the 1 client per IP problem, but it is untested, so people are bound to find bugs, anyone wants a shot?

Re: LUBE (Networking Library)

Posted: Fri Jan 15, 2010 7:40 pm
by bartbes
Well, Skasi found one, I missed 2 characters (!), well, it works now, same version number, in the OP.

Re: LUBE (Networking Library)

Posted: Wed May 19, 2010 8:41 am
by Lap
When using a udp connection everything works fine. When using TCP the server crashes on trying to use acceptAll()

Code: Select all

	lube.server:Init(tonumber(port), "tcp")
	lube.server:setCallback(recv, conn, disconn)
	lube.server:setHandshake("Allô")
	lube.server:setPing(true,10, "PING")
	lube.server.tcp:acceptAll()
Lube.461 attempt to index field "socket" a nil value

this is the line

local client = self.socket:accept()

Re: LUBE (Networking Library)

Posted: Wed May 19, 2010 2:32 pm
by bartbes
It handles protocol abstraction for you, so your call should be:

Code: Select all

lube.server:acceptAll()

Re: LUBE (Networking Library)

Posted: Wed May 19, 2010 4:23 pm
by Lap
Thanks for the quit response. I'm glad I decided to just ask and go to bed than struggle with a problem far simpler than my sleep deprived brain imagined.

Thanks so much for making this library.

Re: LUBE (Networking Library)

Posted: Wed May 19, 2010 8:37 pm
by Lap
Got home and was able to try it. Once I moved the lua.server:AcceptAll() to right before lube.server:update(dt) it worked great.

Do you have any idea how to return the localhost's IP on their own network and the external IP of their router/modem?