TCP server on MATLAB
显示 更早的评论
I can't TCP from MATLAB to MATLAB MATLAB version 2015a
Server Code:
t = tcpip('192.168.1.14', 8000, 'NetworkRole', 'Server');
set(t, 'InputBufferSize', 900000);
fprintf('waiting for client \n');
fopen(t);
fprintf('client connected');
MATLAB waiting for client when I use
fopen(t)
when I'm trying to connect from another PC on the same network I use this Code:
tc = tcpip('192.168.1.14', 8000,'NetworkRole','Client');
fopen(tc)
on the Client PC return no errors after fopen(tc) 'that's mean the Server is working fine
but on the Server PC .. It still waiting for client without detecting the Client and jump to
fprintf('client connected');
when I tried both of these codes on the same PC using different versions of MATLAB it worked fine on the server and Client .. .......
there is another problem there .. I don't need the code to be paused for waiting a client I need there is no Client: do something If client exist do something else
Thank you
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 TCP/IP Communication 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!