5.0

5.0 | 1 rating Rate this file 74 downloads (last 30 days) File Size: 3.35 KB File ID: #25249

TCP/IP Socket Communications in MATLAB using Java Classes

by Rodney Thomson

 

07 Sep 2009

Code covered by BSD License  

A simple example TCP/IP server and client using a helper Java class

Download Now | Watch this File

File Information
Description

Provides an example Server / Client written in MATLAB that utilises the ability to call Java to perform message communication using TCP/IP.

Similar to my previous example (http://www.mathworks.com/matlabcentral/fileexchange/21131) but allows for much more efficient data transmission by using a helper Java class to minimise function call overhead.

To use the example:

- Start 2 instances of MATLAB
- in the first execute the following:
  message = char(mod(1:1000, 255)+1);
  server(message, 3000, 10)
- in the second execute the following:
  javaaddpath('<path to where the .class file is located>');
  data = client('localhost', 3000)

For more details see:
http://iheartmatlab.blogspot.com/2009/09/tcpip-socket-communications-in-matlab.html

MATLAB release MATLAB 7.8 (R2009a)
Other requirements Although I have developed it in MATLAB 2009a, it should work on versions as far back as R14.
Zip File Content  
Other Files client.m,
data_reader.java,
DataReader.class,
license.txt,
server.m
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
16 Nov 2009 Kevin Bartlett  
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
tcp Rodney Thomson 08 Sep 2009 12:53:22
ip Rodney Thomson 08 Sep 2009 12:53:22
socket Rodney Thomson 08 Sep 2009 12:53:22
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com