Giter Club home page Giter Club logo

multipeer's People

Contributors

mikaelho avatar mithrendal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

multipeer's Issues

current code is not reentrant when multipeer.py is included as an API

hi @mikaelho

the code is not reentrant if I do extract the demo chat code from multipeer.py into a separate file lets say demochat.py.

demochat.py runs fine the first time, but when you exit it and run it again it will not find any peers.

the curios thing is that when you run the demochat inside the multipeer.py then you can exit and rerun it as often you like it will always find the peers.

In other words, running the multipeer.py itself is completely reentrant. But calling the multipeer API from another file is not.

Do you have any ideas ?

Maybe it has something to do with the delegates, which you only create once??

speed tests

Hi @mikaelho

i made a small program to speed test the different communication modes of multiplier connectivity via your API. For the test it send small text string 'ping' over to another peer that peer answers the incoming message with a 'reping'. The program does this 1000 times to get a reasonable average.
So here are the results for the different modes:

11.85ms send method unreliable
11.94ms send method reliable
6.19ms stream method

there is effective no difference in latency whether using send method mode reliable or unreliable. When you run the test again it is unpredictable which one has lower latency.
But stream makes really the difference.

When I measured it last month or so, I saw unstable latency values with the send method. But it turned out that the latency came from the GUI, (maybe garbage collector?) sometimes I saw values of 240 or so.

Now I changed the benchmark program that it takes 1000 probes automatically without GUI intervention. And the 1000 probes are very close to each other I see no statistical outliers anymore.

So yeah. You brought latency effectively down a lot with streams. So great!!!

Before I saw these good values for streams, I had to remove some debug code in multipeer.py. You still have some debug-log code in method 'stream_handleEvent_' where you write to a file named 'l'. I also disabled global logging by inserting a 'pass' into the method 'log_this'. Maybe you still would like to do some housekeeping ? Or should I do it and send you the pull request ?

Thanks a lot for this addition !!! This is soo great !

Undefined name 'MultipeerConnectivity' in multipeer_chat.py

flake8 testing of https://github.com/mikaelho/multipeer on Python 3.6.3

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./multipeer_chat.py:9:18: F821 undefined name 'MultipeerConnectivity'
  class ChatPeer(MultipeerConnectivity):
                 ^
./multipeer_chat.py:11:6: F821 undefined name 'on_main_thread'
    @on_main_thread
     ^
./multipeer_chat.py:15:6: F821 undefined name 'on_main_thread'
    @on_main_thread
     ^
./multipeer_chat.py:24:6: F821 undefined name 'on_main_thread'
    @on_main_thread
     ^
4     F821 undefined name 'MultipeerConnectivity'
4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.