[ENet-discuss] 1.0 imminent - any requests?
Rene Dudfield
rene1 at py3d.org
Sat Dec 27 19:54:39 PST 2003
Lee Salzman wrote:
> I'm almost ready to declare a 1.0 release. I think I've finally
>worked out the last of the stupidity in the throttling and connection
>handling, and also committed Scott's new pyenet stuff. Could you guys
>try the CVS and make sure it works, gimme feedback, etc.?
>
> Also, are there any particular features or changes you would like to
>ENet before the 1.0 and that can't wait for another point release?
>
>Lee
>
>
Hi,
Tried out the enet cvs today.
A few changes were needed to enet.pyx to account for the changed
ENetPeerState enum. Changed Client.py and Server.py to account for the
new pyenet api.
It seems the new pyenet uses a different api than the old one. Seems ok
though. The new api is more a close copy of enet c api. Which makes
some things a little harder. However not too hard as the enet c api is
quite easy :)
here's the results from cvs diff enet.pyx test/Client.py test/Server.py
Index: enet.pyx
===================================================================
RCS file: /home/enet/cvsroot/enet/pyenet/enet.pyx,v
retrieving revision 1.1
diff -r1.1 enet.pyx
96,99c96,100
< ENET_PEER_STATE_CONNECTED = 2
< ENET_PEER_STATE_DISCONNECTING = 3
< ENET_PEER_STATE_ACKNOWLEDGING_DISCONNECTION = 4
< ENET_PEER_STATE_ZOMBIE = 5
---
> ENET_PEER_STATE_ACKNOWLEDGING_CONNECT = 2
> ENET_PEER_STATE_CONNECTED = 3
> ENET_PEER_STATE_DISCONNECTING = 4
> ENET_PEER_STATE_ACKNOWLEDGING_DISCONNECT = 5
> ENET_PEER_STATE_ZOMBIE = 6
162a164
> PEER_STATE_ACKNOWLEDGING_CONNECT =
ENET_PEER_STATE_ACKNOWLEDGING_CONNECT
165c167
< PEER_STATE_ACKNOWLEDGING_DISCONNECTION =
ENET_PEER_STATE_ACKNOWLEDGING_DISCONNECTION
---
> PEER_STATE_ACKNOWLEDGING_DISCONNECT =
ENET_PEER_STATE_ACKNOWLEDGING_DISCONNECT
Index: test/Client.py
===================================================================
RCS file: /home/enet/cvsroot/enet/pyenet/test/Client.py,v
retrieving revision 1.2
diff -r1.2 Client.py
3,4c3,6
< host = enet.host(1, 28 * 1024, 9 * 1024)
< peer = host.connect(('127.0.0.1', 5000), 2)
---
> host = enet.Host (None, 1, 0, 0)
>
> peer = host.connect(enet.Address('127.0.0.1', 5000), 2)
>
6c8,10
< result, event = host.service(10000)
---
>
>
>
8,13c12,20
< if 0 < result:
< if enet.EVENT_RECEIVE == event.type:
< print '* CLIENT: Channel', event.channel, 'Received',
event.data
< msg = 'ping' + str(i)
< print '* CLIENT: Sending', msg
< peer.send(0, msg, 0)
---
> event = host.service(100)
>
> if enet.EVENT_TYPE_RECEIVE == event.type:
> print '* CLIENT: Channel', event.channelID, 'Received',
event.packet.data
> msg = 'ping' + str(i)
> print '* CLIENT: Sending', msg
> peer.send(0, enet.Packet(msg))
>
>
Index: test/Server.py
===================================================================
RCS file: /home/enet/cvsroot/enet/pyenet/test/Server.py,v
retrieving revision 1.2
diff -r1.2 Server.py
3c3,5
< host = enet.host(('127.0.0.1', 5000), 16, 56 * 1024, 14 * 1024)
---
>
>
> host = enet.Host(enet.Address('127.0.0.1', 5000), 16, 56 * 1024, 14 *
1024)
6,12c8,13
< result, event = host.service(60000)
< if 0 < result:
< if enet.EVENT_RECEIVE == event.type:
< print '* SERVER: Received Chan:', event.channel, 'Data:',
event.data
< elif -1 == result:
< print '* SERVER: Problem servicing host'
< break
---
> event = host.service(1000)
>
> if enet.EVENT_TYPE_RECEIVE == event.type:
> print '* SERVER: Received Channel', event.channelID,
'Received', event.packet.data
>
>
Have fun!
More information about the ENet-discuss
mailing list