开发者

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

开发者 https://www.devze.com 2022-12-10 14:19 出处:网络
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 no

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

精彩评论

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

关注公众号