Timeout when running tcpip in server mode OR how to force fopen to return after a set timeout
조회 수: 12 (최근 30일)
이전 댓글 표시
Hello all,
t = tcpip('localhost',30000,'NetworkRole','server')
fopen(t)
I can then use this connection to send files between Matlab instances (such as me and my lab mate). However, fopen does not return until a connection has been made by someone. While I can ctrl-C to get out of this, you cannot ctrl-C in a deployed application AND this drops us out of the entire program rather than letting us skip this step and move on with other operations. Nominally I would want a connection timeout option for the tcpip object, but there is no such property or method.
So, I can see 3 possible options,
- Run fopen asynchronously so that even if it is sitting there waiting till the dawn of time, the rest of my code can continue to execute.
- Run fopen with some sort of timeout enforced externally during the call (something like FEX timeout, but not using ctrl-C. I just want to force the fopen command to return after a reasonable period).
- Modify tcpip itself to allow for a timeout.
The middle is my favorite, since I can use that for other code. Any ideas?
-DP
댓글 수: 1
Darshan Vijayaraghavan
2020년 6월 4일
Can you explain on how or elaborate more on the 2nd point that you mentioned above?
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Audio and Video Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!