如何制作客户端服务器应用程序c#

如何制作客户端服务器应用程序c#

问题描述:

问候,



我需要有关如何开发基于客户端服务器的应用程序的帮助。客户端将能够向服务器发送文本。服务器将执行一些处理和API调用,然后将文本返回给客户端。实现这一目标的好方法是什么?在.NET中存在任何异步解决方案(如Tornado for Python),这样UI就不会挂起,客户端仍然可以正常运行。



谢谢和问候。

Greetings,

I need help about how to develop a client server based application. The client would be able to send a text to the server.The server would do some processing and API calls and then return the text back to the client. What would be a good way to achieve this? Do any asynchronous solutions exist for this in .NET ( like Tornado for Python) so that the UI doesn't get hung up and the client can still function.

Thanks and Regards.

有几个选项,但取决于你的项目的要求。

1. TcpListener和TcpClient

2.在较低级别的客户端套接字和服务器套接字
WCF

5.带有IP和端口号的Windows服务和客户端发送请求并等待响应。

6.使其成为带有Web页面界面的Web应用程序。然后浏览器中的页面就是客户端。
There are several options but depend on the requirements of your project.
1. TcpListener and TcpClient
2. At lower level Client Socket and Server Socket
3. Web Service and SOAP client with method stubs generated by wsdl tool from Visual Studio
4. WCF
5. Windows Service with IP and port number and Client sends requests and waits for responses.
6. Make it a web application with Web Page interface. The page in the browser is then the Client.


您可以使用TCP套接字或WCF。



请尝试以下链接 -

异步套接字服务器和客户端 [ ^ ]

WCF中带有异步/等待的简化异步编程模型 [ ^ ]

基于任务的WCF中的异步操作 [ ^ ]
You can use either TCP sockets or WCF.

Try these links below -
An Asynchronous Socket Server and Client[^]
Simplified Asynchronous Programming Model in WCF with async/await[^]
Task-based Asynchronous Operation in WCF[^]