哪种适合我的情况? WCF,套接字编程或... [英] Which is suitable for my scenario? WCF , Socket Programming , or ...

查看:52
本文介绍了哪种适合我的情况? WCF,套接字编程或...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想制作一个程序,该程序应分为两部分.一台服务器和一堆客户端.服务器也具有一些功能和客户端.

例如,服务器要求客户端提供一些信息,客户端应予以回答.它们都应该发送和接收数据,并且此数据的大小可能很大(大约5MB).而且我希望能够将DataTable从客户端发送到服务器.

另一件事是我想在具有Domain的Lan网络中使用此程序.

考虑到实现的简便性和速度,我应该使用哪种结构.

谢谢

新问题:
我看了一下链接,并学到了一些有关双工通信的知识.但是以我得到的方式,我们有一个服务(我应该称其为服务器)提供了一些操作,并且我们有使用这些操作的客户端.并且此操作通过回调使用客户端的另一种操作.我的问题是我有一个主程序,也许我可以在局域网中的任何节点上运行它.这个主程序显示了我域中的计算机列表.每个计算机都有一个本地IP地址.我想向选定的客户端发送一些请求,并且客户端必须向服务器返回一些数据.请引导我如何做这样的事情,谢谢

Hi
I want to make a program which should be in two part. a Server and a bunch of Clients. Server has some functions and clients too.

for example Server asks for some information from client , and client should answer it. both of them should send and receive data and the size of this data could be large.(about 5MB). and i want to be able to send DataTable from client to server.

one another thing is I want to use this program in a Lan Network with Domain.

which structure i should use?with considering the ease and speed of implementation.

thanks

New Problem :
I looked at the link and i learned a little about Duplex communication. But in the way i got this,we have a service (which i should call it server) offers some operations and we have clients which uses these operations. and this operations through a callback uses another operation of the client. my problem is I have a Main Program which maybe i run it from on any node in my lan. this Main program displays a list of Computers in my domain.each one has a local Ip Address.I want to send some requests to the selected client and client must return some data to server. please guid me how can i do such a thing thanks

推荐答案

您可以通过3种方式实现它:

1.套接字编程-在这里,您将必须以文本形式发送所有数据,并且从文本到数据集的数据组装/分解将由应用程序负责.可以选择协议.

2. Web服务-如果仅使用HTTP进行通信,则可以使用Web服务. [这里只有一种通讯方式]

3. WCF-与Web服务基本相同的功能,但是提供了更多访问协议,例如http,tcp,ipc等.[使用它,您也可以进行数据双工通信]

所以我建议您根据需求,时间框架和知识进行分析,然后进行处理.

P.S. Web服务可能是最简单的. WCF似乎是您最好的选择.

更正了Pete O''Hanlon先生指出的问题[/EDIT]
You can implement it in 3 ways:

1. Socket programming - Here you will have to send all the data in text form and the assembling/dissembling of data from text to data-set will be the applications responsibility. choice of protocols is available.

2. Web-service - You can have a web-service if the only HTTP will be used for communication. [Here only one way communication is possible]

3. WCF - essentially the same functionality as web service but gives more protocols to access like http, tcp, ipc etc. [using this you can have data duplex communication too]

so I would suggest you do an analysis based on requirements, time frame and knowledge and then process.

P.S. web service will perhaps be the easiest. WCF seems to be best in your case.

Corrected the problem (thankfully) pointed out by Mr. Pete O''Hanlon [/EDIT]


鉴于您要实现双工通信的事实,并考虑到以下事实: WCF是一个框架,允许您使用多种不同的协议,我建议您从提出的选择中选择WCF.为了了解如何在WCF中实现双工通信,您应该阅读 [ ^ ]
Given the fact that you want to implement duplex communication, and given the fact that WCF is a framework that allows you to use multiple different protocols, I would recommend WCF out of the choices you present. In order to get an idea on how to implement duplex communications in WCF, you should have a read of this[^] article.


套接字编程对我来说是最好的方法,因为我已经完成了这种类型的工作(不是一样,但是这种类型)并且我使用了套接字编程
Socket Programming is the best approach according to me because i have done this type of work(not same but this type of) and i used socket programming


这篇关于哪种适合我的情况? WCF,套接字编程或...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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