TCP Output Socket

version (5.4 KB) by Rodney Thomson
MATLAB TCP Output Socket using a Java helper class for threaded client connection management


Updated 21 Jun 2010

View License

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.


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

For more details and an explanation of the Java helper class see:

Cite As

Rodney Thomson (2022). TCP Output Socket (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2009a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!