tags:

views:

26

answers:

1

I need to set up a UDP reader in Matlab that receives data from a number of sources. I typically use this for a single data source:

[packet,~,~,senderaddress]=fread(s,s.BytesAvailable)

The problems are that I want to avoid waiting for the timeout, I don't have terminated data arriving, and packets are of unknown sizes. Has anyone else had this problem? Thanks

A: 

Why not using Java's networking capabilities. UDP File Exchange does some Java scripting to access a UDP socket. Define the max size of your packets (UDP datagrams can be up to 65536 bytes long) and the preferred timeout.

zellus
I've tried the Java approach before, and the issue is not in opening the connection or the accepting of packets. The problem is setting the timeout so for maximum throughput. With only a single remote unit sending packets at fixed intervals, this isn't a problem at all. With the current setup, I have multiple remote units sending at non-fixed intervals. Unfortunately, the packets don't have termination either, so I can't use fgetl or even fgets. I installed the new Matlab version R2010b and I don't seem to have any problems with s.BytesAvailable usage. We'll see though. Thanks!
Jeff
I don't understand what you mean by packet termination. To my understanding any UDP frame (packet) has a given length, which is indicated in the frame header.
zellus

related questions