简体   繁体   English

C#中的异步TCP协议

[英]Async tcp protocol in c#

I'm about to implement a server-client protocol over TCP with the following features: 我将通过具有以下功能的TCP实现服务器-客户端协议:

  1. Request and response functionality 请求和响应功能
  2. Authentication 认证
  3. Server side initiated messages 服务器端发起的消息

All over one single TCP connection. 全部通过一个TCP连接。

Each request and response will contain multiple variables such as in a HTTP POST request but there might be a need for more nested structures, perhaps some object serialization. 每个请求和响应都将包含多个变量,例如在HTTP POST请求中,但可能需要更多嵌套结构,可能还有一些对象序列化。

I have an idea of how to implement this from the ground up. 我对如何从头开始实现这一想法有所了解。

My question, is there any existing protocol, preferably with helpful functions in c# that does this? 我的问题是,是否存在任何现有协议,最好是在c#中具有有用功能的协议?

Also this will be implemented in c# but a protocol that just as easily can get implemented in other languages is a plus. 同样,这将使用c#来实现,但是一个可以轻松地用其他语言实现的协议是一个加号。

Why not try and useWCF, which supports communication over TCP 为什么不尝试使用支持TCP通信的WCF

http://msdn.microsoft.com/en-us/library/ff649818.aspx http://msdn.microsoft.com/en-us/library/ff649818.aspx

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM