[ENet-discuss] enet_host_bandwidth_limit

Ng Yao Kheng ngyaokheng at hotmail.com
Tue Jun 3 22:33:52 PDT 2008


Hi all,
 
I rephrase my last question reagrding BW. I understand that ENet provide some sort of BW. I am wondering how or what should I check before I call enet_host_bandwidth_limit function. Would really appreciate a example?
 
Thanks for your help?
 
Regards,
Yao Kheng
 
> Date: Tue, 3 Jun 2008 15:26:56 -0700> From: lsalzman1 at cox.net> To: enet-discuss at cubik.org> Subject: Re: [ENet-discuss] ENet-discuss Digest, Vol 61, Issue 1> > Note, you don't set the client's address to ENET_HOST_BROADCAST (pass in > NULL for the client's address structure to enet_host_create as usual). > You attempt to connect to ENET_HOST_BROADCAST, which will send out the > connection request to the broadcast address, which will just broadcast > anywhere on the LAN. If there's something on the other end of the LAN > waiting to accept, it will get a connection from it. If there are > multiple servers on the other end that pick up the broadcasted connect > request, then whichever replies back first wins. There should be nothing > different about it otherwise.> > You don't have to do anything special for LAN vs. internet for server > addresses. Same stuff I described in previous email about IP applies.> > Lee> > Ben Johnson wrote:> > Wow, thanks for the fast reply.> > > > You cleared up quite a bit of my confusion, too.> > > > I ditched my vector of peer pointers, and am now using the host->peers > > instead.> > Also, instead of using a dummy connection when I want to play > > on non-dedicated server, I do something like this:> > > > maxPlayers = 12;> > if(!dedicated) maxPlayers--;> > host = enet_host_create(&address, maxPlayers, 0, 0);> > serverPlayer = maxPlayers;> > > > this will only allow for 11 other players to join. And they will fill > > spots 0 to 10 in the host->peers array.> > The player the server now controls is player[serverPlayer] - which is > > the 12th and final player. So I don't have to worry about it being > > replaced, etc..> > > > Hooray, first 4 questions solved!> > > > As far as question 5 goes, I'm now using ENET_HOST_ANY. Regarding > > LAN.. what should I do then? Keep it as ENET_HOST_ANY? I read > > somewhere that the client should then set it's address to > > ENET_HOST_BROADCAST, and that will return any server addresses? I > > tried, but it didn't work.. Do I have to connect twice or something? > > Once to find the address, and then again to connect to it?> > > > Also, can a server host for both LAN and the internet at the same > > time? So anyone can join, whether they're in the LAN or on the net? If > > not, for testing purposes, is it possible for me to use my second > > computer which is on the LAN, but get it to join via the internet, so > > I can check to see if I've got both the LAN connection and the > > internet connections working properly. I've been reading a lot about > > NAT punch-through, so I imagine I might have to deal with that in the > > future, as I am using a router.. but hopefully I can get at least LAN > > working first.> > > > Thanks again!> > Ben.> > _______________________________________________> ENet-discuss mailing list> ENet-discuss at cubik.org> http://lists.cubik.org/mailman/listinfo/enet-discuss
_________________________________________________________________
NEW! Get Windows Live FREE.
http://www.get.live.com/wl/all
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubik.org/pipermail/enet-discuss/attachments/20080604/7232ac3f/attachment.htm>


More information about the ENet-discuss mailing list