简体   繁体   English

C#-将WCF用于本地网络客户端/服务器软件

[英]C# - Using WCF for a local network client/server software

I'm working on this project where I have 7 PCs connected to a switch, one of them is the server. 我正在这个项目中,我有7台PC连接到交换机,其中一台是服务器。

The clients wont send/receive data between each other, they will only send some "characters/strings" to the server. 客户端之间不会相互发送/接收数据,它们只会向服务器发送一些“字符/字符串”。 Also, the server will send "characters/strings" to the clients. 同样,服务器将“字符/字符串”发送给客户端。 Also, I need to know on the server software if the clients are connected normally. 另外,我需要在服务器软件上知道客户端是否正常连接。

So I read that using WCF is the best way of doing this program. 因此,我读到使用WCF是执行此程序的最佳方法。 Also, I guess it can work normally using TcpClient in C#. 另外,我猜它可以在C#中使用TcpClient正常工作。

So what's the best way for dealing with such case? 那么处理这种情况的最佳方法是什么? Any good tutorials or example that can be of help? 有什么好的教程或示例可以提供帮助吗?

Thanks. 谢谢。

WCF is a good solution and allows an easy way for enrich the comunication in the future. WCF是一个很好的解决方案,并为将来丰富通信提供了简便的方法。 You can host the service in any .net project (console application, web prohect, windows forms or wpf). 您可以在任何.net项目(控制台应用程序,Web Prohect,Windows窗体或wpf)中托管服务。 Adding the reference via Visual Studio and use the proxy is straightful and you won't need the TcpClient (actually I don't think it would work). 通过Visual Studio添加引用并使用代理很简单,并且您不需要TcpClient(实际上我认为它不会起作用)。

Your needs seems to be very simple so I suggest you to take a look at the followind web cast: https://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032344313&culture=en-US The first is more than enough. 您的需求似乎非常简单,所以我建议您看一下followind网站上的广播: https : //msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032344313&culture=en-US第一个绰绰有余。

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

相关问题 C#-WCF可在本地计算机上运行,​​但不能通过网络运行 - C# - WCF works on local machine, but not over network 客户端应用程序在C#中在本地网络上查找服务器的最佳方式是什么? - What is the best way for a client app to find a server on a local network in C#? C#可以安全地每隔5秒从200台客户端PC ping服务器(在本地网络中)吗? - C# is it safe to ping server (in local network) from 200 client PCs every 5 seconds? 客户端连接服务器C#网络 - Client connect server c# network 如何使用C#从Web客户端浏览本地网络? - How can I browse the local network from a web client using C#? 如何从sql server播放mp3字节块,使用C#转移到桌面客户端(通过wcf)? - how to play chunks of mp3 bytes from sql server, transferred to desktop client (by wcf) using C#? 如何使用C#将对象从RESTful客户端发送到WCF RESTful服务器 - how to send an object from RESTful client to WCF RESTful server using C# C#WCF将数据从服务器上运行的任务传递到客户端 - C# WCF pass data from Task running on Server to Client “参数不正确。” RSACryptoServiceProvider WCF客户端/服务器C# - “The parameter is incorrect.” RSACryptoServiceProvider WCF Client/Server C# 从服务器发送列表,但如何在客户端(WCF)C#中打印 - send a list from server, but how to print in the client (WCF) C#
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM