ASP.NET和放大器; TCP服务器解决方案 [英] ASP.NET & TCP Server Solution

查看:144
本文介绍了ASP.NET和放大器; TCP服务器解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的服务器上运行有两个应用程序:

My server has two applications running on it:


    ,不断地接收和发送信息到
  1. TCP套接字服务器
       从客户端(C#.NET的WinForms)

  2. ASP.NET应用程序

我需要的是:


  • 当从一个客户端通过TCP连接(应用程序1)我要的ASP .NET应用程序(APP 2)动态地反映该数据接收的消息。我意识到,我可以通过TCP套接字,它将再由ASP.NET应用程序被拾起设置数据库条目。

  • 将消息发送到从ASP .NET应用程序客户端可用的TCP套接字服务器内
  • 客户的一种方式
  • When a message is received from a client via the TCP connection (app 1) I want the ASP .NET application (app 2) to reflect this data dynamically. I realise that I can set database entries via the TCP socket, which will then be picked up by the ASP.NET application.
  • A way of sending messages to clients from the ASP .NET application to clients that are available inside of the TCP socket server

例如。其中,客户端发送一个简单的聊天程序的的和服务器响应的欢迎的。在ASP .NET应显示日志这次谈话,因为它发生。立即。如果我点击ASP应用程序的按钮,它应该代表套接字服务器到客户端发送消息的你已经接受到服务器

e.g. A simple chat program where a client sends "Hi" and server responds "Welcome". The ASP .NET should show a log of this conversation as it happens. Immediately. And if I click a button on the ASP application, it should send a message on behalf of the socket server to the client "You have been accepted onto the server"

有关的大多数情况下,这些消息将是相当短的像此处显示的

For the most part, the messages are going to be fairly short like the ones shown here.

什么是做A和B的最佳方式?

What is the best way to do A and B?

推荐答案

如果您的信息大多是文本,你可能想看看的 SignalR

if your "messages" are mostly textual, you may want to take a look at SignalR.

SignalR是一个新的库asp.net,使实时网络功能。

SignalR is a new library for asp.net to enable real-time web functionality.

它使用的WebSockets(或长轮询如果WebSockets的不可用在服务器/客户端)。

It uses websockets (or long polling if websockets is unavailable at server/client).

它有不同的客户端类型的支持。

It has support for different client types.

这篇关于ASP.NET和放大器; TCP服务器解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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