how to avoid tcpclient function open new ports all the time ?

3 views (last 30 days)
does anyone know how to avoid Matlab open a new port, everytime something received via tcp ?
Cant find anything about it in the documentation but opening and closing a port decreases performance a lot.
t = tcpclient("",1045,"Timeout",1,"ConnectTimeout",300);
%t.BytesAvailabeFcn = @readbuffercallback; %if condition reached go to callback;
%data2 = 0;
%data = int8(data2);
datareceive = read(t,4,"uint8");
app.ServerantwortEditField.Value = int2str(datareceive);
with matlab2021a the old functions doesnt work anymore.
I just want to open a socket connection with one port and pass data through continiously.

Answers (0)


Community Treasure Hunt

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

Start Hunting!

Translated by