Coder Social home page Coder Social logo

Comments (8)

Dynesshely avatar Dynesshely commented on May 24, 2024

延伸思路:
我们也许可以提供多种模式来完成自发现

  1. 持续广播模式, 即现有广播模式
  2. 介绍人模式, 即 @StardustSeemsInk#217 提到的方式
  3. 村口广播模式, 即主控持续广播本机消息, 加入组网的设备不广播, 新设备自行加入主控组网

from kitx.

Cranyozen avatar Cranyozen commented on May 24, 2024

于 2023.5.27 更新 (From QQ Group)
可用的详细思路:
介绍人找朋友模式 (主控为介绍人)

  1. 请求阶段
    • 连续发送若干个广播包请求主机, 观察是否有主控回应
  2. 连接阶段
    • 主控回应了从控的请求 (发送 ip 地址等信息) , 从控连接
  3. 建立阶段
    • 没有主控回应, 自己建立主控
    • 等待阶段
      • 观察广播包是否有新的自组网请求

此模式具体的好处为:

  1. 仅在从控自组网时才会有网络请求的产生
  2. ... 待补充

from kitx.

ChenPi11 avatar ChenPi11 commented on May 24, 2024

一般的内网,设备很少变化,所以可以整个上一次的连接历史,提高连接速度(这点特别适合虚拟机-实体机组网)
启动时阅读连接历史,尝试连接这些设备。连接错误或连接过程不要报出来
这个功能可以设置开启或关闭供用户选择

from kitx.

Dynesshely avatar Dynesshely commented on May 24, 2024

可用的详细思路: 介绍人模式 (主控为介绍人)

  1. 请求阶段

    • 连续发送若干个广播包请求主机, 观察是否有主控回应
  2. 连接阶段

    • 主控回应了从控的请求 (发送 ip 地址等信息) , 从控连接
  3. 建立阶段

    • 没有主控回应, 自己建立主控

    • 等待阶段

      • 观察广播包是否有新的自组网请求

此模式具体的好处为:

  1. 仅在从控自组网时才会有网络请求的产生
  2. ... 待补充

一般的内网,设备很少变化,所以可以整个上一次的连接历史,提高连接速度(这点特别适合虚拟机-实体机组网) 启动时阅读连接历史,尝试连接这些设备。连接错误或连接过程不要报出来 这个功能可以设置开启或关闭供用户选择

好主意

from kitx.

Dynesshely avatar Dynesshely commented on May 24, 2024

Tracked by #223 .

from kitx.

Dynesshely avatar Dynesshely commented on May 24, 2024

Tracked by #224 .

from kitx.

Dynesshely avatar Dynesshely commented on May 24, 2024

延伸思路: 我们也许可以提供多种模式来完成自发现

  1. 持续广播模式, 即现有广播模式
  2. 介绍人模式, 即 @StardustSeemsInk[Rules] On the optimization of self-discovery ad hoc networks #217 提到的方式
  3. 村口广播模式, 即主控持续广播本机消息, 加入组网的设备不广播, 新设备自行加入主控组网

我更加倾向于重写成 3 的模式
即: 启动时监听 udp 广播 5s, 若有收到主控的广播消息直接加入主控网络 (比较建立时间, 加入建立时间最早的主控网络), 若超出此段时间仍未收到主控广播消息, 则认为本机为局域网络第一个设备, 建立主控网络并开始广播主控广播消息, 在此期间, 持续监听是否有其他设备的主控广播消息, 若存在则比较主控网络建立时间, 后建立主控网络的设备自行关闭主控网络.

from kitx.

Dynesshely avatar Dynesshely commented on May 24, 2024

另外, #202 可以合并到此 issue, 有关同步设备时间的问题

from kitx.

Related Issues (20)

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.