Note that there are some explanatory texts on larger screens.

plurals
  1. POSend/Recv Socket Blocking Issues
    primarykey
    data
    text
    <p>another question about my beloved sockets. I'll first explain what my case is. After that I will tell you whats bothering me.</p> <p>I have a client and a server. Both Applications are written in C++ with the winsock2 implementation. The connection runs over TCP and WLAN. WLan is very important, because its probably causing the issue and is definetly going to be the communicationchannel.</p> <p>I'm connecting two sockets to the server. A SendSocket and a ReceiveSocket. I'm constantly sending video data to the server through the sendsocket. The data is processed and gets send back to the client and gets displayed. Each socket got his own thread.</p> <p>The Videodata is encoded, so I achieve like 500kB/s. Lets see this rate as fixed, without explanation.</p> <p>Perfect communication viewed by the client:</p> <pre><code>Send Data Recv Data Send Data Recv Data ... </code></pre> <p>This is for like 100 frames the case.</p> <p>But every couple of frames, the stream freezes for like 4 frames and continues after that. (4 frames are like 500ms)</p> <p>Thats the issue, i'm facing.</p> <p>What happens to the stream is the following:</p> <pre><code>Send Data Recv Data Send Data Send Data Send Data1 -&gt; blocked send Recv Data Recv Data Send Data2 -&gt; not blocked anymore. </code></pre> <p>The Data gets properly sent on server side.</p> <p>Since WLan is not duplex (as far as I know), I thought, that the send calls are prioritized for some reason. And after that the Receive calls are prioritized, so the send call blocks until the recv calls are done.</p> <p>Maybe you can tell me, what is happening in the lower layer, which could cause the problem. Btw. I'm definetly not sure, if its not just a bandwidth issue, but I thought WLAN should be able to handle 500kB/s. This 500kB/s are both upstream and downstream together. Important notice: If I set the framerate to a factor of 1/5, it does not fix the issue.</p> <p>I know it's hard to fix this issue with this insight. I would be happy, if you could share your knowledge, so I may be able to fix it myself. </p> <p>EDIT: Its perfectly fine, if the client recv hangs a litte. But it must not block the send. The server needs data continuosly.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload