It's very useful to build a simple network with MatLab, but in the example you read abyte in a loop. I've tried to read the buffer with the method read (byte [ ] b, int off, int len) of the class DataInputStream, but I don't find anything into the buffer b; the result of this method (the of bytes read) is correct! How can I pass the input buffer to the method?
Sharath,
To receive data continuously, you will need to call read() many times after you have successfully connected to the server.
For high update scenarios, you may want to use the Java class approach (http://iheartmatlab.blogspot.com.au/2009/09/tcpip-socket-communications-in-matlab.html) to read the data in chunks as I doubt you would be able to keep up with 1000Hz data otherwise.
Hello Eric .. I read your problem and I need to communicate with clients and servers in bidirectional mode ... how did you solve your problem? I am not a java expert so I am a bit in trouble ...
sorry for my bad English ..
thanks a lot ..
I have solved my problem. Just write here to share with everyone. I also read a lot java documentations about socket. Finally i think this program is most simple and suitable for our use. We can change it to a bidirectional program according to our requests. This is example is very important. Thanks!
Comment only