TCP/Ip and UDP in Matlab
1 view (last 30 days)
Show older comments
Hi, I'm trying to code for TCPIP n UDP. The case is: Computer is connected to Vector Network Analyzer, I'm running a Matlab application in my computer. BUt now I want to stream data from Network analyzer to computer. I'v written some code using matlab help. but since its live streaming data i'm facing a problem. Plizz help
11 Comments
Walter Roberson
on 10 Dec 2011
No UNIX does NOT require multiple threads for that. You use select() with a timeout structure that uses a time of 0 in order to poll to see if something is ready. Or you use the newer poll(), but I would need to cross-check to see if that made it in to POSIX.
If you require non-cooperative multi-processing, then you can fork() off a Unix process to do the work, with the new process either taking over the socket directly, or continuing to use the listener process to handle multiple sockets and forward packets as they become available.
The fundamental Unix process inetd() was written LONG before there was multithreading in Unix.
I own physical copies of the 1989 ANSI C standard, and of the 1990 POSIX.1 standard. Neither one of them has threads. At the time of the 1990 POSIX.1 standard. POSIX threads were not added to POSIX.1 until they became POSIX.1c in 1995.
If, as you claim, Unix "requires" multiple threads for that situation, then how ever did Unix manage to survive between the time it was created in about 1970, until 1995? (And yes, it did definitely have sockets before that. Sockets were merged from BSD into System V Unix as of SVR4, 1988.)
I have personally programmed multitasking network daemons; I never used multiple threads. Multiple processes sometimes, but not multiple threads.
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!