aresch / pyenet Goto Github PK
View Code? Open in Web Editor NEWA python wrapper for the ENet library
License: BSD 3-Clause "New" or "Revised" License
A python wrapper for the ENet library
License: BSD 3-Clause "New" or "Revised" License
Hi, it's me again. I finally have had some time to try and mess with this some more. The following code, however, fails to work properly. Know of any reason as to why this gives me so many issues?
When I ran python3 setup.py build
, pyenet gave me this message:
You need to download and extract the enet 1.3 source to enet/
Download the source from: http://enet.bespin.org/SourceDistro.html
See the README for more instructions
That web address is incorrect. It should be changed to
I am unable to get pyenet to compile under windows due to linking errors. Some instructions would be greatly appreciated.
hello, how do i set enet_host_compress_with_range_coder
and enet_crc32
in my code? trying to recreate a Growtopia 'proxy' in python.
Maybe im a little dumb or what, but i really need your help guys.
So i make a new function:
def disconnect():
# enet_host_destroy(server)
exit()
so my question is, is there any method like enet_host_destroy
in this package? if there's any, where i should find it?
Thanks
I tried to connect pyenet to C++ program's enet server. But pyenet didn't connect. I used test_client.py to connect. (Ofc I changed ip and port)
during the creation of piqueserver/piqueserver#361, I noticed that the enet callbacks swallow any exceptions in python space silently.
The enet library has support for setting a function to use to intercept incoming packets before enet processes them (see this commit).
Would it be possible to support this in pyenet?
Hello, I'm trying to convert c++ project to python project. There is something called checksum in enet. But I didnt found any in this project. I'm just looking a way to set host checksum to enet_crc_32. Any ideas what I can do?
When using pyenet in a python project on repl.it a peer will stay connecting forever.
import enet
host = enet.Host(None, 1, 0, 0, 0)
peer = host.connect(enet.Address(b"35-225-183-118.noodlecakegames.net", 42775), 1)
while 1:
event = host.service(1000)
print(f"Is still connecting: {peer.state == enet.PEER_STATE_CONNECTING}")
if event.type == enet.EVENT_TYPE_CONNECT:
print("%s: CONNECT" % event.peer.address)
host.service(0)
break
I have tested this locally on my mac and the output would be (as expected)
Is still connecting: False
35.225.183.118:42775: CONNECT
However when attempting to run in repl.it you would get this forever:
Is still connecting: True
Is still connecting: True
Is still connecting: True
Here is a repl you can run the code on yourself: https://replit.com/@theblakiemon/ENET-Test#main.py
I think this is a bug, but if I'm doing something wrong then what? Why won't it work? Is it because the repl.it environment doesn't have needed dependencies?
#Client code import enet host = enet.Host(None, 1, 0, 0, 0) peer = host.connect(enet.Address(b"localhost", 54301), 1) while 1: event = host.service(1000) if event.type == enet.EVENT_TYPE_CONNECT: print("%s: CONNECT" % event.peer.address) break
#server code
import enet
host = enet.Host(enet.Address(b"localhost", 54301), 10, 0, 0, 0)
while 1:
# Wait 1 second for an event
event = host.service(1000)
if event.type == enet.EVENT_TYPE_CONNECT:
print("%s: CONNECT" % event.peer.address)
break
how can i set the enet_crc32
?
I've tried building on both Windows 10 and a fresh Linux (Ubuntu 20.04.2.0 x64) install, and got the same error on both platforms.
Have I missed something here? Any help would be appreciated. Thanks in advance.
Linux build output follows:
python3 setup.py build
running build
running build_ext
cythoning enet.pyx to enet.c
/home/Novark/.local/lib/python3.8/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /home/Novark/.local/lib/python3.8/site-packages/pyenet/enet.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
building 'enet' extension
creating build
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/enet
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DHAS_POLL -DHAS_FCNTL -DHAS_MSGHDR_FLAGS -DHAS_SOCKLEN_T -DHAS_GETHOSTBYNAME_R -DHAS_GETHOSTBYADDR_R -Ienet/include/ -I/usr/include/python3.8 -c enet.c -o build/temp.linux-x86_64-3.8/enet.o -O3
enet.c: In function ‘__pyx_pf_4enet_4Peer_13needsDispatch___get__’:
enet.c:11053:62: error: ‘ENetPeer’ {aka ‘struct _ENetPeer’} has no member named ‘needsDispatch’
11053 | __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_enet_peer->needsDispatch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 767, __pyx_L1_error)
| ^~
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Hi,
I just looked at this as someone asked me for help setting up a Python coding environment, and it doesn't appear that there's any wheels on Pypi. What are the chances of getting at least Windows wheels?
If it's helpful, I can probably script the process for you via the Python 3 launcher, but obviously I can't upload them as I'm not the package owner.
He's going to need 3 packages. This, Pyglet/Pygame, and my audio library. The latter two aren't a problem, but getting someone new to Python set up to build C packages is somewhat troublesome. I'll probably build one for him and do it that way, but it would be useful if I didn't have to in future.
I wanted to ask if pyenet is still alive?
Would be nice to have that one too for calling enet_socket_send
. The signature would be
cdef class Socket:
def send(self, Address address, data):
I wanted to set the host checksum to enet_crc32. How can I set it??
When Address is being created with an argument which is not an instance of bytes
, pyenet will through and error.
Because of the following:
https://github.com/aresch/pyenet/blob/master/enet.pyx#L226
bytes() only takes in 1 argument.
Also, there's no way to specify host as None
with this bytes() conversion...
https://pypi.python.org/pypi/pyenet/1.3.13.1
The pyenet package seems to no longer exist
i want to set ENet Checksum to enet_crc32, but how?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.