简体   繁体   English

桌面应用程序与服务器之间的套接字通信

[英]Socket communication between desktop application and server

I need to be able to synchronize PC desktop application (.NET) with my server (Java), instead the PC will always ask the server if there is something new (polling) I thought about open socket protocol between the two which means if there is something new the server will notify the PC directly. 我需要能够将PC桌面应用程序(.NET)与我的服务器(Java)同步,相反,PC总是会询问服务器我是否考虑过两者之间的开放套接字协议这是新的(轮询),这意味着是服务器将直接通知PC的新内容。

The first thing I saw is web socket protocol which is nicely supported in Spring 4 framework (good for my server), the thing is that the protocol isn't supported in the .NET framework running in my PC app. 我首先看到的是Web socket协议,该协议在Spring 4框架中得到了很好的支持(对我的服务器非常有用),但事实是该协议在我的PC应用程序中运行的.NET框架中不受支持。

Is it possible to use the open socket protocol in my server side but the PC app will communicate with lower level protocol? 是否可以在服务器端使用开放套接字协议,但PC应用程序将与较低级别的协议进行通信?

I never implemented that kind of communication before I usually stick to REST protocol can some shed some light on the subject? 在我通常遵循REST协议之前,我从未实现过这种通信,可以使您对此有所了解吗?

thanks in advance. 提前致谢。

In case web socket is not an option on the .NET side, adding long polling to the server side might be a step in the right direction. 如果在.NET端不能使用Web套接字,则向服务器端添加长时间轮询可能是朝正确方向迈出的一步。

Long polling in spring using DeferredResult 使用DeferredResult在春季进行长轮询

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM