Giter Club home page Giter Club logo

socket-app's Introduction

socket apps

for Network Test using RPI

Requirements

Python 2.7

timeout_decorator

  • ubuntu, raspbian
$ sudo apt-get install python-pip
$ sudo pip install timeout_decorator
  • mac
(pyenv)$ pip install timeout_decorator

Usage

  • parent_bc.py
$ python parent_bc.py <dst-ip> <num-child> <interval>
$ python parent_bc.py 192.168.88.255 16 0.1
  • parent_bc_exact_polling.py
$ python parent_bc_exact_polling.py <dst-ip> <num-child> <interval>
$ python parent_bc_exact_polling.py 192.168.88.255 16 0.1
  • parent_uc.py
$ python parent_uc.py <dst-ip> <src-port> <interval>
$ python parent_uc.py 192.168.88.102 30003 0.1
  • child.py
$ python child.py

socket-app's People

Contributors

msrks avatar mitsuhiroito avatar

Watchers

 avatar

socket-app's Issues

ログをバッファリングせずに、リアルタイムに出力したい

この記事がドンピシャでした。
https://serverfault.com/questions/294218/is-there-a-way-to-redirect-output-to-a-file-without-buffering-on-unix-linux

要約すると、

課題

ファイルサイズが大きくなるとバッファリングが発生してリアルタイムにログを追えなくなってしまうので、なんとかしたい

解決策

$ command > log.txt

ではなく、stdbufを使って

$ stdbuf -oL command > log.txt

とする。一行単位でバッファする。

もし行のバッファも嫌なら下記(だが使うことはないかな)

$ stdbuf -o0 command > output

親アプリのポーリング間隔を 1.0sにする

現状、ポーリング間隔は 子からの応答時間 + whileループのinterval(sleep時間) となっており、ポーリング間隔が 応答時間 に依ってしまう。

解決策

sleep時間を以下のように可変で定める

sleep時間 = ポーリング間隔 - 子からの応答時間

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.