Comments (6)
- queue for websocket messages
from zeronet.
Would async managing this be able to help? Or is it because the greenlets are trying to attach to the same socket?
from zeronet.
It happened when i ran the zeronet on remote machine (around ~40ms away) and downloaded a site with many small files.
The ZeroNet pushes pushes an event over websocket after every file download, and maybe the last event message was still not finished when the next came.
I think it could be fixed like this:
def send(message):
self.message_queue.append(message)
if not self.sending:
self.sending = True
while self.message_queue:
self.socket.send(self.message_queue.pop(0))
self.sending = False
Maybe there is a better solution with gevent, but i like pure-python solutions, its easier to understand whats really happening.
Btw I optimized the Websocket to much smaller event messages, maybe its not an issue anymore, im going to test it later.
from zeronet.
The gevent queue is as understandable as a straight python implemented queue and it seems easy to use.
http://www.gevent.org/gevent.queue.html
one example they use at the bottom:
def worker():
while True:
item = q.get()
try:
do_work(item)
finally:
q.task_done()
q = JoinableQueue()
for i in range(num_worker_threads):
gevent.spawn(worker)
for item in source():
q.put(item)
q.join() # block until all tasks are done
from zeronet.
I think this model will not work in this case, because we dont want to send messages in parallel and we dont want to wait until the message is sent
from zeronet.
ran into this problem again, so i fixed it:
Line 71 in e8368a8
from zeronet.
Related Issues (20)
- How to use ZeroNet on Android? HOT 10
- zeroid not working for create id HOT 4
- Spammers attack ZeroNet with hostile forks in order to defraud ZeroNet users. HOT 41
- UnboundLocalError: local variable 'err' referenced before assignment
- Unhandled exception: AttributeError: 'Site' object has no attribute 'greenlet_manager'
- ZeroNet version
- Unhandled exception: ModuleNotFoundError: No module named 'socks'
- tracker connection error detected and content.json downloading failed even using tor with bridge HOT 1
- ZeroNet's successor: The Peer-to-Peer Network HOT 4
- Security problem on ZeroMail (and all zeromail clones) need to be allowed [email protected]: (the auth address), malicious user can read, delete, send messages have full access to your mailbox! HOT 3
- ReDoS in built-in file editor (UiFileManager) due to outdated codemirror lib
- Hello Dev . Command not work
- Unhandled exception: RuntimeError: dictionary changed size during iteration HOT 2
- Unhandled exception: AttributeError: 'ConfigPlugin' object has no attribute 'getCmdlineValue'
- UI Change For the Website HOT 1
- Zeronet HOT 2
- offline, moving data using esp or usb flash
- Low seeded zites can be manipulated, they can be rendered unusable security issue
- Use Lokinet network
- deletion of false orphans at startup when appending --ui_ip '*'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zeronet.