[ENet-discuss]pyenet: how to send data from server to client.
Rene Dudfield
illumen at yahoo.com
Tue Jul 22 03:04:20 PDT 2003
Ling Lo wrote:
>Rene Dudfield [illumen at yahoo.com] wrote:
>
>
>>Ling Lo wrote:
>>
>>I get a segfault when I do:
>>print dir(event.peer)
>>
>>
>
>Fixed... I was incrementing reference count on a null attributes. Oops.
>I've attached the patch, to be executed in /enet/pyenet. Still not too sure
>if I'm doing the right thing, I can't get the new-style classes thing going
>(where you can set attributes on any object).
>
>
Cool, thanks.
>
>
>>A seperate issue. I get a bit of packet loss when using the reliable
>>packets. I think it may be because I use a very low value for the
>>service call. This is so that my game can continue running whilst
>>networking is being handled(without using a seperate thread). Perhaps
>>the enet.FLAG_RELIABLE is not being passed through as the same number
>>as the c api expects? Or maybe there is a problem with the c api?
>>
>>
>
>Packet loss is to be expected over WAN, it's part of normal operations. I'd
>be really surprised if you get some problem in a local loop.
>
>
Yeah, I get this in the local loop.
>
>
>>Another issue I have is to do with disconnecting clients. If a client
>>calls the disconnect method but does not wait around for the
>>disconnect reply from the server, then the server still thinks the
>>connection is open. This can be repeated, leading onto the server
>>not accepting anymore connections. Is there a way to change the
>>disconnection timeout? Or maybe some other method of trying to
>>prevent this type of abuse?
>>
>>
>
>This is a general quirk of connectionless protocols.
>
>How about adding a layer of authentication? The client immediately sends
>over login/password and if not valid gets disconnected (peer.disconnect)
>within 2 seconds. Also, raise the number of maximum hosts above the
>expected number of playing clients and reserve them for admin.
>
>
Sounds like a plan.
>
>
>>Attached are some .py files which illistrate my problems.
>>
>>Any help appreciated :)
>>
>>
>>For the loss of reliable packets:
>>
>>python -u atest_networking_enet.py server > /tmp/asdfasdf
>>python -u atest_networking_enet.py bench_client
>>grep hi /tmp/asdfasdf | wc -l
>> 998
>>
>>hi should be printed 1000 times.
>>
>>
>
>I can't reproduce this... Also, you imply you're doing this on the same
>machine which shouldn't have any packet loss. You can get packet loss
>figures using:
>
> peer.packetloss
>
>
What os are you on? I'm on debian linux 2.4.20
>Also, roundtriptime is another handy peer attribute, they're in the pyenet's
>incredibly brief documents.
>
>Sorry about the utter lack of reply for a while, just slowly getting back
>into my bedroom coding persona.
>--
> | Ling Lo
>_O_O_
>
>
Thanks for the reply :)
More information about the ENet-discuss
mailing list