Git Product home page Git Product logo

Comments (5)

Neutree avatar Neutree commented on June 13, 2024 1

这个跟多网卡应该没关系。

.1是PC的话理论上应该可以才对,我这里测试两台之间通信是没问题的,
image

没办法复现你的现象,暂时不太清楚问题在哪儿

from comtool.

Neutree avatar Neutree commented on June 13, 2024 1

lambda是默认值,在这里设置的 https://github.com/Neutree/COMTool/blob/d7bb5aa087cc58d94c36c3442196b318dfc97c10/COMTool/pluginItems.py#LL204C43-L204C53
然后会在这里

self.plugin.onReceived(data)
调用具体插件的 onRecieved 方法

既然你可以调试,方便的话可以调试一下应该就能发现问题了

from comtool.

Neutree avatar Neutree commented on June 13, 2024

你这是 15在向.1网关发送数据呀,跟comtool有啥关系

from comtool.

zhang-stephen avatar zhang-stephen commented on June 13, 2024

你这是 15在向.1网关发送数据呀,跟comtool有啥关系

15是外部设备,.1是PC的网口,comtool却收不到这些数据?是我的comtool配置的不太对?

from comtool.

zhang-stephen avatar zhang-stephen commented on June 13, 2024

看了下UDP部分的实现,socket是绑定到0.0.0.0:<port>上的,这里没有问题

但是在onReceiveProcess函数中,收到的data会附加到buffer,然后丢给self.onReceived()处理,这个方法继承自Comm.onReceived,这个lambda方法是空的?收到的数据没有被处理嘛?

我不太了解pyqt的开发,不过尝试复现了一下UDP的接收,如有疏漏,请指出。

附:

我自己写的socket测试代码:

import socket
from datetime import datetime

sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

sock.bind(("0.0.0.0", 7000))

while True:
    recv, addr = sock.recvfrom(1024)
    now = datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S.%f")[:-3]
    print(f"{now}: client: {addr}, data size: {len(recv)}")

测试结果:
image

from comtool.

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.