Tcp Client 双向通信帮助 [英] Tcp Client two way communication help

查看:77
本文介绍了Tcp Client 双向通信帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用客户端和服务器在 C# 中的两个应用程序或 winform 之间进行通信就像我想要一个服务器不断地监听来自一个或多个客户端的传入消息,当收到消息时,我想回复给发送信息进行处理的客户端,任何人都可以帮助代码示例

I want to communicate between two applications or winforms in C# using clients and server its like i want a server continiously listening to incoming messages from a client or clients and when the msg is received i want to reply back to the client that sent the information for processing can any one help with code example

推荐答案

听起来像是在 Intranet 环境中使用 netTcpBinding 的 WCF 的好案例!:-)

Sounds like a good case for WCF using netTcpBinding in an intranet environment! :-)

查看这些 WCF 介绍:

Check out these intros to WCF:

  • Getting started with WCF
  • WCF Templates and Tools
  • WCF Developer Center
  • WCF Getting Started - Videos, Screencasts, Whitepapers

Aaron 有一个特别好的一系列截屏视频Skonnard(也可从 WCF 入门部分获得),它逐步并以简单的部分解释了如何开始和运行您在 WCF 中的第一次冒险!:-)

There's an especially good series of screencasts with Aaron Skonnard (also available from the WCF Getting Started section) which explains step by step and in easy portions how to get up and running with your first adventures in WCF! :-)

此外,WCF 确实为点对点网络提供特定支持,例如发现和建立同级节点之间的通信 - 请在此处查看有关该主题的一些文章:

Also, WCF does offer specific support for peer-to-peer networking, e.g. discovery and establishing communications between sibling nodes - see some articles on that topic here:

与基于套接字的手工制作"解决方案相比,WCF 为您提供了大量无需担心的现成管道代码 - 安全性、可靠性、消息加密、事务支持等等.如果您可以使用现成的,为什么要自己做这一切?

Compared to a "hand-crafted" solution based on sockets, WCF gives you a lot of ready-made plumbing code which you don't have to worry about - security, reliability, message encryption, transaction support, and much more. Why do that all yourself, if you can just use it ready-made?

马克

这篇关于Tcp Client 双向通信帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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