3.0

3.0 | 1 rating Rate this file 13 Downloads (last 30 days) File Size: 5.4 KB File ID: #27975
image thumbnail

TCP Output Socket

by Rodney Thomson

 

21 Jun 2010

MATLAB TCP Output Socket using a Java helper class for threaded client connection management

| Watch this File

File Information
Description

An output socket that allows zero or more TCP client connections to be made.

A separate thread manages the client connections allowing for multiple clients to connect and disconnect at any time.

Not just for data communication but also useful as a debug output monitoring tool.

Usage:

output_port = 1234;
output_socket = MatlabOutputSocket(output_port);

% Write a string out
output_socket.write(int8(sprintf('Hi there how are you?\r\n')));

% Write some raw data out
output_socket.write(rand(4, 'single'));

% close socket connection
output_socket.close();

For more details and an explanation of the Java helper class see:
http://iheartmatlab.blogspot.com/2010/06/non-blocking-output-socket.html

MATLAB release MATLAB 7.8 (R2009a)
Other requirements The MatlabOutputSocket class requires the new MATLAB OO paradigm (so 2008a onwards). However people with older versions (As far back as R14) can utilise the Java class for socket communications.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
12 Jul 2011 zhang  
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
tcp Rodney Thomson 22 Jun 2010 11:14:23
socket Rodney Thomson 22 Jun 2010 11:14:23
java Rodney Thomson 22 Jun 2010 11:14:23

Contact us at files@mathworks.com