it meet errors when I use read(t)#TCP/ip
Show older comments
could you help me?why does it meet errors when I use read(t)
clc;
clear
%% 主机端
% echotcpip("on",5000)
[~,hostname] = system('hostname');
hostname = string(strtrim(hostname));
address = resolvehost(hostname,"address");
server = tcpserver(address,5000,"ConnectionChangedFcn",@connectionFcn);
configureCallback(server,"off")
server.NumBytesAvailable
%% 客户端
t = tcpclient(address,5000);
data = uint8(1:2);
write(t, data);
pause(1)
read(t,1)
Accepted Answer
More Answers (0)
Categories
Find more on Interface-Based Instrument Communication in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!