socket.engine
socket.engine copied to clipboard
This lib is broken
Hello,
It seems that this lib looks really awesome, but in reality nothing seems to be working. Even the examples posted in the docs don't work at all, I tried nearly all python examples, and sometimes it works but most of the time I have to heavily edit the docs to get it working, and even then it seems not to be working correctly (spam and repeating messages).
Am I very stupid today or is this package just not working? (anymore).
Example:
from socketengine import Transport
transport = Transport(name='test')
transport.openForConnection(port=8080)
transport.write('channel_name', 'Hello World!')
transport.close()
Name was not in the documentation, but required, and when it finally runs:
/usr/bin/python3.6 /home/berm/Development/Hobby/test.py
Traceback (most recent call last):
File "/home/berm/Development/Hobby/test.py", line 4, in <module>
transport.openForConnection(port=8080)
AttributeError: 'Transport' object has no attribute 'openForConnection'
This is the documentation (Images, which I think is pretty weird for code?): https://github.com/0xJeremy/socket.engine/raw/master/graphics/python_documentation/transport_example_1.png
So sad because this was exactly what I needed for my usecase.
Hey there. Currently the master branch is under some development (we're changing the way messages are sent and received). For the time being I would recommend using the latest release version. If you download the zip of the code from the release all the docs that come packages should be up to date, and the code there is fully tested and working.
Give this a shot and let me know! If it's still not working them I will take a closer look into the issue.
Hey thanks for your reply! If I run pip show socket-engine i get the following:
Name: socket.engine
Version: 1.0.0
Summary: A universal communication engine
Home-page: https://github.com/0xJeremy/socket.engine
Author: Jeremy Kanovsky
Author-email: [email protected]
License: UNKNOWN
Location: /usr/lib/python3.6/site-packages
Okay, so I removed the package and downloaded the zip file v1 found in releases, and installed it with the following commands:
unzip python.zip
sudo python3.6 -m pip install -e /home/berm/Downloads/python
The code seems to be working, but the host keeps spamming the same message, even when the client dissconnects with the example code provided.
Host output (*1000 more in reallife, it spams)
client is connected!
client is connected!
client is connected!
client is connected!
client is connected!
Host:
from socketengine import host
h = host()
h.start()
while True:
data = h.get_ALL("test")
if data is not None:
for item in data:
print(item)
break
h.close()
Client:
from socketengine import client
c = client()
c.start()
c.write("test", "client is connected!")
c.close()
can confirm this continues to happen. It infinitely sends the message over and over again to no end.
the same issue