简体   繁体   English

将数据从 Python 实时发送到 .NET Core

[英]Sending data in real-time from Python to .NET Core

So we have a .NET core application running on a server with SignalR, basically this application moves an object on the screen under realtime, The SignalR application have a function所以我们有一个 .NET 核心应用程序在带有 SignalR 的服务器上运行,基本上这个应用程序在屏幕上实时移动一个对象,SignalR 应用程序有一个功能

    public async Task SendMessage(string x, string y)
    {
        await Clients.All.ReceiveMessage(x, y);
    }

Within the application I can send the new x and y and the object is moved, but the problem is that we get the data (x, y) from a Python application and we want to send it to the .NET Core application in real-time.在应用程序中,我可以发送新的 x 和 y 并移动对象,但问题是我们从 Python 应用程序获取数据 (x, y) 并且我们希望将其实际发送到 .NET Core 应用程序 -时间。

What is the best solution for this problem and also is sending and receiving the data with HTTP GET a good solution?这个问题的最佳解决方案是什么,并且使用 HTTP GET 发送和接收数据是一个很好的解决方案? something like:就像是:

    [Route("Send/{x}/{y}")]
    public async Task Send(string x, string y)
    {
        await _strongTagHubContext.Clients.All.ReceiveMessage(x,y);
    }

I think I might have the solution to your inquiry:\\我想我可能有解决您查询的方法:\\

To communicate between 2 softwares that use are "differently coded"(like DOTNET and PYTHON ), the best way is to simply connect using TCP .要在使用“不同编码”的 2 个软件(如DOTNETPYTHON )之间进行通信,最好的方法是简单地使用TCP连接。

Connect the TCP once both softwares are loaded and ready, and keep it alive to communicate.一旦两个软件都加载并准备好,就连接 TCP,并保持它的活动状态以进行通信。 As simple as that就如此容易

I hope that resolved your problem, let me know if that's not the case :)我希望解决了您的问题,如果不是这样,请告诉我:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用python从多台计算机实时向中心位置发送数据的方法 - method of sending data from multiple computers too a central location in real-time using python 如何从ROS实时获取Python中的数据? - How to get data in python from ROS in real-time? 如何从IBapi for Python获取实时流数据? - How to get real-time steaming data from IBapi for Python? Python中的实时中断 - Real-time interrupts in Python Python中的实时动画 - Real-time animation in Python 从时间序列数据进行实时异常检测 - Real-time anomaly detection from time series data 如何使用 Python (Django) 从多个网站连续获取一些特定的实时数据? - How to get some specific real-time data from several websites continuously using Python (Django)? 如何使用从 python 套接字接收的实时数据创建和更新 SQL 数据库? - How to create and update a SQL database with real-time data received from a python socket? 如何在Python的字典中使用来自alphavantage API的实时数据? - How can I consume real-time data from alphavantage API in python's dictionary? 如何使用角度7从服务器(python)实时获取数据以保持UI更新? - How to fetch the data using angular 7 from the server (python) in the real-time to keep UI updated?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM