LUBE (Networking Library)

Showcase your libraries, tools and other projects that help your fellow love users.
stampede
Prole
Posts: 21
Joined: Fri Oct 23, 2009 8:22 am
Location: Finland
Contact:

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

Post 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
stampede
Prole
Posts: 21
Joined: Fri Oct 23, 2009 8:22 am
Location: Finland
Contact:

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

Post 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...
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

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

Post by bartbes »

No, acceptAll should be called directly before update, for best results.
stampede
Prole
Posts: 21
Joined: Fri Oct 23, 2009 8:22 am
Location: Finland
Contact:

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

Post 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
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

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

Post 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?
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: LUBE (Networking Library)

Post by bartbes »

Well, Skasi found one, I missed 2 characters (!), well, it works now, same version number, in the OP.
User avatar
Lap
Party member
Posts: 256
Joined: Fri Apr 30, 2010 3:46 pm

Re: LUBE (Networking Library)

Post 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()
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: LUBE (Networking Library)

Post by bartbes »

It handles protocol abstraction for you, so your call should be:

Code: Select all

lube.server:acceptAll()
User avatar
Lap
Party member
Posts: 256
Joined: Fri Apr 30, 2010 3:46 pm

Re: LUBE (Networking Library)

Post 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.
User avatar
Lap
Party member
Posts: 256
Joined: Fri Apr 30, 2010 3:46 pm

Re: LUBE (Networking Library)

Post 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?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest