简体   繁体   English

在Visual Studio中查看signalR聊天应用程序的消息流

[英]Viewing message streams in Visual Studio for signalR chat application

I recently found a .NET tutorial that showed me how to make a simple chat application in Visual studio using the .NET library, . 我最近发现了一个.NET教程,向我展示了如何使用.NET库, 在Visual Studio中创建一个简单的聊天应用程序。

I have created the application and made a few moderations including some AES encryption. 我创建了应用程序并进行了一些调整,包括一些AES加密。 I have then hosted it on Windows Azure as a website. 然后我将其作为网站托管在Windows Azure上。

The chat application works and has been tested, but I don't know how to view the messages sent from one user to the other. 聊天应用程序工作并已经过测试,但我不知道如何查看从一个用户发送到另一个用户的消息。

Can someone tell me where I can find these message streams? 有人能告诉我在哪里可以找到这些消息流吗?

Thanks 谢谢

All messages will go through the SignalR Hub, so you could either use breakpoints/debugging to see what is send (if you are running in your development environment). 所有消息都将通过SignalR Hub,因此您可以使用断点/调试来查看发送的内容(如果您在开发环境中运行)。 Otherwise you could use tracing in the Hub to see the messages. 否则,您可以在Hub中使用跟踪来查看消息。

There is a extension to glimpse that you might use (I haven't tested it though): http://www.nuget.org/packages/Glimpse.SignalR 您可以使用(我尚未对其进行过测试): http//www.nuget.org/packages/Glimpse.SignalR

You can get some performance counters using the tools provided by Microsoft. 您可以使用Microsoft 提供工具获得一些性能计数器。

For what I know there is no way to get all messages send or received from the server. 据我所知,没有办法从服务器发送或接收所有消息。 When you need to analyze the communication of specific clients, try to use Wireshark or Microsoft Network Monitor . 当您需要分析特定客户端的通信时,请尝试使用WiresharkMicrosoft网络监视器

You could also write your own message logger that writes them to file. 您也可以编写自己的消息记录器,将它们写入文件。

You can use common methods as Trace.WriteLine to write info to the default listener. 您可以使用常用方法Trace.WriteLine将信息写入默认侦听器。 Then use a listener to write to file / database. 然后使用侦听器写入文件/数据库。

This source may be useful when learning to analyze messages from a webserver. 在学习分析来自Web服务器的消息时, 此源可能很有用。

Fiddler is the best tool for monitoring web traffic. Fiddler是监控网络流量的最佳工具。 It's stupid easy to use and has a lot of extended features to help debug server/client applications. 它愚蠢易于使用,并具有许多扩展功能,以帮助调试服务器/客户端应用程序。 Take a look at this page which includes a brief description of using Fiddler with signalr. 请看这个页面 ,其中包括使用Fiddler和signalr的简要说明。

Good luck! 祝好运!

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

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