2

im trying to use pipe via .net v4.0 on winforms application background

heres my code -->

public void main()
{
    using (NamedPipeServerStream pipeserver = new NamedPipeServerStream("colors", PipeDirection.Out,4))
    {

        pipeserver.WaitForConnection();
        try
        {
            using (StreamReader sr = new StreamReader(pipeserver))
            {
                string data = sr.ReadLine();
                ConvertToGuiColor(data);
            }
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.ToString());
        }
    }
}

trying to understand why Exception "All instances Pipe Are busy" thought maybe because

pipeserver.WaitForConnection();

,but the Exception is throwing in this : "using (NamedPipeServerStream pipeserver = new NamedPipeServerStream("colors", PipeDirection.Out,4))" command

ty for helpers sKY Walker

doctorlove
  • 18,872
  • 2
  • 46
  • 62
SkyWalker
  • 21
  • 2
  • Is this https://stackoverflow.com/questions/17570652/all-instances-busy-exception-on-named-pipe-creation helpful? – doctorlove May 30 '17 at 11:30

0 Answers0