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

3 views (last 30 days)
Hi,
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("192.168.11.1",1045,"Timeout",1,"ConnectTimeout",300);
%configureCallback(t,"byte",4,@readbytesfunction);
%t.BytesAvailabeFcn = @readbuffercallback; %if condition reached go to callback;
%readasync(t);;
%data2 = 0;
%data = int8(data2);
%write(t,data);
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.
Thanks.

Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by