locked
AnonymousPipeClientStream Detect binary message received. Rinse. Repeat RRS feed

  • Question

  • I have a Solution with two WinForms projects that set up AnonymousPipe communication between them.
    When the server launches the client, the client pipes are created from the passed handle strings okay.
    I want to keep the client ready to receive many messages, which may be seconds apart or hours apart, but the client is to stay up waiting for messages and responding as they come in.
    I figured I would have a timer fire periodically, but in the timer tick method, how do I detect a message is coming in? or finished?

    Thanks,

    Jon Jacobs, There are 10 kinds of people: those who understand binary and those who don't

    Saturday, April 18, 2020 11:16 PM

Answers

  • You can just call Read.  The Read call will block until data is available.

    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    • Marked as answer by Jon Q Jacobs Sunday, April 19, 2020 3:33 AM
    Sunday, April 19, 2020 3:30 AM

All replies

  • You can just call Read.  The Read call will block until data is available.

    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    • Marked as answer by Jon Q Jacobs Sunday, April 19, 2020 3:33 AM
    Sunday, April 19, 2020 3:30 AM
  • Thank you. That works.

    Jon Jacobs, There are 10 kinds of people: those who understand binary and those who don't

    Sunday, April 19, 2020 3:33 AM