Will do! Thanks man.
EDIT - Good lord, UDP holepunch sounds complicated. I'll try port opening first, if that's possible.
Of course, it's not going to be possible in general, so if anyone has successfully implemented UDP holepunch with LUBE, let me know.
LUBE (Networking Library)
Re: LUBE (Networking Library)
Just thought I'd chip in as there's some stuff that's not really explained and any new people that come across this might get a bit confused as to the capability of the library. I've also cleaned up the wiki a bit with the functions that were missing and/or incorrect.
The library does support nested tables, you just have to call lube.bin:setseperators. For example, I used it to pack up each player object on screen, then packed the variables I wanted to send again for each player object. I'll just put a little thing from my code here that I did as an example. So when I packed, I used char 1 and 2 first, then packed again with 30 and 31 which are smiley faces and triangles (if anyone wants to know).
Awesome library btw, once you know how it works, it's dead easy to use.
The library does support nested tables, you just have to call lube.bin:setseperators. For example, I used it to pack up each player object on screen, then packed the variables I wanted to send again for each player object. I'll just put a little thing from my code here that I did as an example. So when I packed, I used char 1 and 2 first, then packed again with 30 and 31 which are smiley faces and triangles (if anyone wants to know).
Code: Select all
function Client.receive(data)
lube.bin:setseperators(string.char(30),string.char(31))
local datatable = lube.bin:unpack(data)
local playertable = {}
for n,p in pairs(datatable) do
lube.bin:setseperators(string.char(1),string.char(2))
playertable[n] = lube.bin:unpack(p)
-- Now everything is unpacked you call your own function to do something with it
playerobject[n]:updatedata(playertable[n])
end
end
Re: LUBE (Networking Library)
I'm having some trouble with lube. ( )
My problem involves sending data from server to client with udp.
At first, on sending it was convinced that self.clients was nil, but I got around this because I'm using my own method of tracking ips/ports.
Now, it thinks self.socket is nil. If it means anything, this is happening after server creation.
My problem involves sending data from server to client with udp.
At first, on sending it was convinced that self.clients was nil, but I got around this because I'm using my own method of tracking ips/ports.
Now, it thinks self.socket is nil. If it means anything, this is happening after server creation.
Re: LUBE (Networking Library)
Might be worth including your code, hard to see where you're going wrong otherwise.
Re: LUBE (Networking Library)
Basically, I'm using the example at the top of page 22.
Re: LUBE (Networking Library)
Well the example didn't include any sending so I'm still going to need your code to see how to fix it.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: LUBE (Networking Library)
Nor does it contain that custom code of yours, which is the interesting part .
Re: LUBE (Networking Library)
I can't really fix this problem since i don't experience it, but it goes something like this:
Player starts a TCP server and joins it and then for whatever reason he ends the connection ungracefully (i.e. Love crashes). When trying to start the program and create another TCP server it fails to open a socket since the last one still hasn't closed. The player needs to wait 10-30 seconds or so for that last socket to close. This was reported on Ubuntu I believe and I don't personally have any problems on Win 7.
There any setting I can change to fix this?
Player starts a TCP server and joins it and then for whatever reason he ends the connection ungracefully (i.e. Love crashes). When trying to start the program and create another TCP server it fails to open a socket since the last one still hasn't closed. The player needs to wait 10-30 seconds or so for that last socket to close. This was reported on Ubuntu I believe and I don't personally have any problems on Win 7.
There any setting I can change to fix this?
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: LUBE (Networking Library)
You could add this before line 458 (that's lube.server.tcp:startserver)
Code: Select all
self.socket:setoption("reuseaddr", true)
Re: LUBE (Networking Library)
I haven't had testers report back yet, but I actually already added that same line, but using 'false' because:
http://w3.impa.br/~diego/software/luasocket/socket.html
says that all sockets bound already have that option set to true. Figured I'd change it and hope for better results. Did you actually mean false, or does LUBE somehow not have it automatically set to true?
http://w3.impa.br/~diego/software/luasocket/socket.html
says that all sockets bound already have that option set to true. Figured I'd change it and hope for better results. Did you actually mean false, or does LUBE somehow not have it automatically set to true?
Who is online
Users browsing this forum: No registered users and 9 guests