英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论