Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><code>ReadLine</code> hangs because it is waiting for a newline, which your test message doesn't include.</p> <p>If you want the server to send messages continuously just put a loop round the <code>WriteFile</code> call. You don't need to connect more than once. Similarly in the client, put the loop around <code>ReadLine</code>.</p> <p>If each message consists of text terminated by a newline then that should suffice, but if you really want the pipe client to work in message mode you need to call:</p> <pre><code>pipeClient.ReadMode = PipeTransmissionMode.Message; </code></pre> <p>However, I doubt this would interact well with a <code>StreamReader</code>. Instead, you should read single messages using <code>pipeClient.Read</code>.</p> <p><strong>Update</strong></p> <p>To answer your new question:</p> <p>On the server, once the client has connected enter a loop in which:</p> <ul> <li>The server does a read from the client. This will block until the client requests a frame.</li> <li>The server sends a frame.</li> </ul> <p>On the client, once it has connected to the server enter a loop in which:</p> <ul> <li>The client sends a "please send a frame" message.</li> <li>The client does a read from the server to get the frame.</li> <li>The client displays the frame.</li> </ul> <p>I wouldn't use a message mode pipe. If the frames are fixed in size then the client knows how much data to read from the server. Otherwise, precede the frame with a uint containing its length.</p>
 

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