[enet-cvs]
CVS: enet/pyenet/test Client.py,NONE,1.1 Server.py,NONE,1.1
Lee Salzman
enet at sferik.cubik.org
Thu May 22 17:17:26 PDT 2003
- Previous message: [enet-cvs]CVS: enet/pyenet licence.txt,NONE,1.1 pyenet.c,NONE,1.1
pyenet.def,NONE,1.1 readme.txt,NONE,1.1 setup.py,NONE,1.1
- Next message: [enet-cvs]CVS: enet protocol.c,1.15,1.16
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/enet/cvsroot/enet/pyenet/test
In directory sferik:/tmp/cvs-serv2122/test
Added Files:
Client.py Server.py
Log Message:
Added pyenet
--- NEW FILE: Client.py ---
import enet
host = enet.host(1, 28 * 1024, 9 * 1024)
peer = host.connect(('127.0.0.1', 5000), 2)
print '* CLIENT: Connected to localhost 5000:', peer
result, event = host.service(10000)
for i in range(10):
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)
host.flush()
peer.disconnect()
--- NEW FILE: Server.py ---
import enet
host = enet.host(('127.0.0.1', 5000), 16, 56 * 1024, 14 * 1024)
print '* SERVER: Created and listening on port 5000:', host
while 1:
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
- Previous message: [enet-cvs]CVS: enet/pyenet licence.txt,NONE,1.1 pyenet.c,NONE,1.1
pyenet.def,NONE,1.1 readme.txt,NONE,1.1 setup.py,NONE,1.1
- Next message: [enet-cvs]CVS: enet protocol.c,1.15,1.16
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the enet-cvs
mailing list