How to debug TCP connection between MATLAB and C++?

Hi,
I have a MATLAB script that communicates via pnet mex file with an executable built via C++ using winsock library. The C++ executable streams data off of a device and then transmits that data into MATLAB via TCP. Every so often, MATLAB hangs or crashes during communication. I'd like to find out why this is happening and fix the problem but I'm not sure how to go about debugging a process in which a MATLAB script is calling on multiple executables of multiple languages (MATLAB and C++) that are working together simultaneously.
How would you suggest I go about debugging this entire communication process?
Thank you!

답변 (1개)

Walter Roberson
Walter Roberson 2015년 6월 1일

0 개 추천

You should get tcpdump or equivalent program.

댓글 수: 2

David
David 2015년 6월 1일
Hi Walter, thank you for your response. I installed tcpdump, got it up and running, but when I'm running the MATLAB/C++ process I mentioned and run tcpdump simultaneously (pointing to the correct port) I get no captured packets (only filtered packets). Any ideas?
You may need to have elevated permissions to capture the packets.
In Unix-type systems tcpdump is only able to capture packets for processes with the same EUID (owner) as the person running tcpdump, unless the person running tcpdump has complete network access rights (such as sudo)
In MS Windows, I do not know what the access restrictions are.

댓글을 달려면 로그인하십시오.

카테고리

태그

질문:

2015년 6월 1일

댓글:

2015년 6월 2일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by