TCP/IP connection is very slow when using fscanf to read from other computer
7 views (last 30 days)
Hello, I make a connection to other operating system and send the data using fprintf and recieve using fscanf. Below is code for all- It is running perfectly fine but while receiving it is very slow. It wait for around 6-10 sec and then receive the data. How can I make it fast. My data is not big.
t2 = tcpip('192.168.56.101', 8001, 'NetworkRole', 'client');
set(t2, 'InputBufferSize', 30000);
while (get(t2, 'BytesAvailable') > 0)
DataReceived = fscanf(t2,'%c')
Can you help me out how to make it fast as my data is not big.