开发者

Alternative to pipeStream.WaitForConnection, a way to pass messages?

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();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜