LUBE (Networking Library)

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

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

Post by bartbes »

No, you're all right, except for a few things. If you manually call client:disconnect the servers disconnect callback gets called as well.
And disconnection isn't 'real' as you're using unconnected UDP. Connect and disconnect actually means setting the server. (well, at least in my implementation)
Have you tried the ping with the newest version?

EDIT: Forgot to set the topic title to 0.6, and I didn't really announce the new version, but it is there.
Matkins
Citizen
Posts: 53
Joined: Mon Mar 23, 2009 5:12 pm

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

Post by Matkins »

Haven't noticed a difference with v0.6
BUT, I did as you did with Netris (Client ping set to 5 secs, Server ping set to 15 secs) and its working fine like that. Cheers again. :)
User avatar
Sparx
Party member
Posts: 125
Joined: Thu Apr 02, 2009 9:54 am
Location: Aachen, Germany

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

Post by Sparx »

Finaly found some time for coding again.
Integrated lube 0.6.. looks fine so far, I didn't have the chance testing it with many clients at the same time but as I said : looks good.

In the documentation i found something regarding broadcasting....
The following things would be very nice:
-A broadcasting how to
-A changelog!!
-A more detailed reference

I know this is frustrating work since i don't like these things myself but is a must.
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 + LUBE-X v0.02

Post by bartbes »

The broadcasting is a specific feature of which I thought the people who were going to use it knew what they were doing, but let me explain it. Broadcasting is sending a package to an entire subnet, which is nothing other than normal operation, except for the different address and the multiple recipients. However, to do broadcasting there is a request that needs to be made to the OS, which is done when you ask LUBE to do so.

So, if you want to connect to all servers on LAN (REALLY not recommended, better to use lube.client.socket:sendto, to send a single message), at port 4000 (example, no clue what it does)

Code: Select all

--code..
--code..
--more code..
lube.client:enableBroadcast()
lube.client:connect("255.255.255.255", 4000) --normally impossible, because 255.255.255.255 is a broadcast address
User avatar
Sparx
Party member
Posts: 125
Joined: Thu Apr 02, 2009 9:54 am
Location: Aachen, Germany

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

Post by Sparx »

maybee i should read more about this myself because i still don't get everything:
so no matter what my own adress is the ip for broadcasting inside the subnet set in my TCP/IP config (default is 255.255.255.0 ?) i need to connect to 255.255.255.255. But how do i set up a server for this or does every server inside the subnet get the connect signal.
And then: for i example i send a "giveinfo" command to all servers running, now all of them respond. Do all messages arrive and is the IP of the server passed on, if yes how do i get it with LUBE?
Because the server telling the client in the respond message wich IP it has, seems no option to me, since a server can have many IPs and doens't know via which the client is connected and if I'm wrong with that how to get this info via LUBE?

Thanks in advance.
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 + LUBE-X v0.02

Post by bartbes »

Yes, well, you're right about that, most of the things you want can only be accomplished by using 'raw' sockets, as I just remembered I let the client filter out anything that didn't come from the server (which it never is, because you're broadcasting). You were right about the fact that every server on the subnet responds to your request. Currently you can always use lube.client.socket, or LuaSocket directly, if you don't use any other LUBE function anyway.

Just a question though, where are you going to use it for? (just interested)

I guess this is a todo for 0.7:
-Allow more raw stuff

EDIT: To answer your question about the changelog, it's on the wiki, and I forgot the changes of 0.6, sorry. (though one of them was moving the changelog :P)
User avatar
Sparx
Party member
Posts: 125
Joined: Thu Apr 02, 2009 9:54 am
Location: Aachen, Germany

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

Post by Sparx »

I want to use the broadcasting for LAN-server-lookup.

I don't know anything about 'raw' sockets or luasocket.... A Lube integration would be great.
As far as I see it the only thing needed would be a returned IP adress of the server sending the response(Ip adress detected by client or server detecing the suitable Ip adress).
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 + LUBE-X v0.02

Post by bartbes »

Well, okay, I'll work on it, but in the mean time, I'm going to have to tell you: I BEAT YOU! :joker:, seriously though, I have already created ServBrowser, the version found here searches only LAN, but I have a version which polls a master server, which is free to use for any other devs as well.
User avatar
Sparx
Party member
Posts: 125
Joined: Thu Apr 02, 2009 9:54 am
Location: Aachen, Germany

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

Post by Sparx »

I see the ServBrowser things but since the reference doesn't explain too much and i have no examples it's hard to go through.

[EDIT]
Sorry just saw the project....
[/EDIT]
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 + LUBE-X v0.02

Post by bartbes »

Sparx wrote:[EDIT]
Sorry just saw the project....
[/EDIT]
That means it's solved?
Anyway, if you need to see how it's implemented (with LoveUI) check out Netris, file=browser.lua
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests