TCP server on MATLAB

3 ビュー (過去 30 日間)
amro
amro 2015 年 4 月 15 日
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 件)

Community Treasure Hunt

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

Start Hunting!

Translated by