[英]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 个软件(如DOTNET和PYTHON )之间进行通信,最好的方法是简单地使用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.