Asynchronous TCP with fwrite: limited bandwidth compared to synchronous communication

1 回表示 (過去 30 日間)
Tom DeLonge
Tom DeLonge 2019 年 3 月 26 日
コメント済み: Tom DeLonge 2019 年 4 月 1 日
When using, e.g.
fwrite(tcpSocket, tcpData, 'uint8', 'async')
I notice that the maximum datarate I can achieve is about 4MBit/s, regardless of buffer size/chunk size. When making use of synchronous fwrite, I easily achieve datarates up to 100MBit/s.
I would prefer to stick to asyncronous writing, since my code is embedded in a GUI that should remain responsive while the data transfer runs in the background. Also the remote tcp side (which is the server in my case) reads data very fast.
Thanks!
  2 件のコメント
Tom DeLonge
Tom DeLonge 2019 年 4 月 1 日
If someone else stumbles upon this. I sent an inquiry to Mathworks and got a reply. They could sucessfully reproduce the problem. They suggested to use parfeval to execute fwrite in the background (without the async argument).
This approach undermines bilateral communication or at least makes it very inconvenient. So I'll try another approach.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeCode Generation for ARM Cortex-M and ARM Cortex-A Processors についてさらに検索

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by