1

My app is being launched via cmd line and if another instance exist i send it the cmd line data via pipes. I am using NamedPipeServerStream ATM. The problem is when i listen for incoming data i may not get it. and ATM because of WaitForConnection is blocking i have no way of terminating my app.

Alternatively i am thinking about not sending the cmd line data and just inserting it to the DB but then i'd need a way to send a msg to the running instance. The way should be mono compatible. I am thinking just dont bother and check the DB for updates every few minutes.

Related Question: Best way to keep a pipe open after a remote close

    using (NamedPipeServerStream pipeStream = new NamedPipeServerStream(pipename))
    {
        pipeStream.WaitForConnection();
Community
  • 1
  • 1
  • @Lloyd: No, what i end up doing was using sqlite to store the data (i used global mutex locks, i dont remember why) and in my winform app i used timer to check the msg queue in the db every X seconds. In a webapp i would just spawn a thread in global_startup. If your using mysql there is an option to store data in a memory only table which can be used –  Feb 02 '11 at 20:16
  • 1
    Ahhh, I seemed to have more luck with BeginWaitForConnection. – Lloyd Feb 03 '11 at 13:48

0 Answers0