检查特定端口上的消息

huangapple go评论47阅读模式
英文:

Check a message on a certain port

问题

我已在C++中编写了一个集成测试,使用gRPC将一条简单文本消息发送给客户端。
我已指定本地主机作为客户端,并使用特定端口,例如8000。
我该如何在本地主机(Windows 10)上检查消息是否已真正到达?
集成测试已通过,我想知道结果是否正确。

英文:

I have written an integration test in c++ which sends a message (a simple text) to a client using gRPC.
I have specified localhost as a client and used certain port, e.g., 8000.
How can I check on localhost (windows 10) to see if the message has really arrived?
The integration test passes and I want to know whether the result is correct or not.

答案1

得分: 1

你可以使用类似Wireshark的网络嗅探工具捕获网络流量,启动Wireshark(或任何其他工具),将其设置为在环回网络接口上捕获,运行测试并筛选使用的端口。你将看到消息是否到达。

英文:

you can use a network sniffer like Wireshark to capture the network traffic, start Wireshark (or any other tool), set it to capture on the loopback network interface, run your test and filter for the port you are using. you will see if the messages arrive.

huangapple
  • 本文由 发表于 2023年2月16日 06:52:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/75466170.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定