服务器PC如何使用Web应用程序与客户端PC通信? [英] How Server PC Communicate with Clients PC using Web Application?

查看:351
本文介绍了服务器PC如何使用Web应用程序与客户端PC通信?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I have 10 Clients on different network(not on LAN) .e.g one is in USA and other in UK and other in Dubai and so on. 

My server PC is in Australia and Server is using Web Application. 
My all clients PC using same Windows application and their own local DB.
Client PC can access to Server using windows Services. But my Question is that ,How Server Will get Data from Client PC using web-services or any in your mind???
Please give any good Idea with example of Sample Code ,  I want just sample code which i will write in my server side Web application and its will fetch data from Clients PC .

Thank you.

推荐答案

对于在客户端计算机上运行的非Web应用程序...没有连接到运行ASP.NET Web应用程序的服务器(但可以访问服务器)... 没办法他们将从服务器获得异步推送通知。 />


您必须在客户端执行某事以检查服务器是否想要更新。最简单的方法可能是使用某种形式的Timer。



另一个想法:当客户端的应用程序启动时,让他们检查服务器以获取特定于客户端的消息(数据)他们应该检查更新的频率,每次客户端更新时,他们都可以检查更新间隔是否已更改,并根据需要修改更新频率。



假设当假设计时器触发客户端登录到服务器时,首先检查是否要求更新:不需要更新:客户端注销。 />


我可以想象更复杂的场景,其中每个客户端在他们的应用程序开始时下载代码来运行,对于他们的机器,不仅将确定更新的频率,而且其他参数,许多人定义他们发送到服务器的数据结构。
For your non-web application running on client's machines ... which are not connected to the server running the ASP.NET web-app constantly (but can access the Server) ... there is no way they will get an asynchronous "push" notification from the Server.

You will have to do something on the Client side to check and see if the Server "wants" an update. The simplest way might be to use some form of Timer.

Another idea: when the client's application starts, have them check with the server to get a client-specific "message" (data) for how often they should check for an update, and every time each client updates, they can check to see if the update interval has changed, and modify the frequency of updating as needed.

Let's say that when the hypothetical timer triggers the client logs-in to the server and, first, check to see if an update is asked for: no update needed: client logs-off.

I can imagine more complex scenarios where each client at the start of their application downloads code to run that, for their machine, will determine not only the frequency of update, but other parameters that many define the structure of their data they send to the server.


听说过这个概念网络 [ ^ ]?



这是一个非常广泛的主题,但简短的回答是,每个客户端都会向您的Web服务器发送一个请求及其位置(IP地址) )以及构成请求的标头,例如哪些资源可以将哪些数据传递给服务器等。服务器接受请求,并对其进行处理。 IP地址和一些其他标头可用于检查它是哪个客户端。大多数服务器使用MAC地址和bla bla。服务器的位置(域名; http://www.example.com)在DNS服务器上注册,DNS服务器会将其转换回IP,这将定义客户端需要连接的服务器的位置至。数据将使用客户端发送的数据包传递到该服务器。



使用他在发出请求时发送的位置(IP地址)将数据发送回客户端。由于它们的IP地址不同,服务器只会发送与计算机相关的数据。
Ever heard of the concept "Networking[^]"?

It is a very broad topic to cover, but the short answer would be, that each and every client sends a request to your web server with its location (IP address) and the headers that make up the request, such as which resource to get what data to pass on to the server etc. The server accepts the request, and works on it. The IP address and a few more headers are usefull to check which client it is. Mostly servers use MAC addresses and bla bla. The location of your server (domain name; http://www.example.com) is registered on a DNS server, which would translate it back to an IP, that would define the location of the server to which the client needs to connect to. The data would be passed to that server using the data packets that are sent by the client.

The data is sent back to the client using the location (IP Address) he sent while making a request. Since their IP addresses are different the server would send the data related to the computer only.


这篇关于服务器PC如何使用Web应用程序与客户端PC通信?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆