public VisualStudioConnectionHandler(CodeLensDataPoint owner, int vspid)
 {
     this.owner = owner;
     stream     = new NamedPipeClientStream(
         serverName: ".",
         PipeName.Get(vspid),
         PipeDirection.InOut,
         PipeOptions.Asynchronous);
 }
Ejemplo n.º 2
0
        public static async Task AcceptCodeLensConnections()
        {
            try {
                while (true)
                {
                    var stream = new NamedPipeServerStream(
                        PipeName.Get(Process.GetCurrentProcess().Id),
                        PipeDirection.InOut,
                        NamedPipeServerStream.MaxAllowedServerInstances,
                        PipeTransmissionMode.Byte,
                        PipeOptions.Asynchronous);
                    await stream.WaitForConnectionAsync().Caf();

                    _ = HandleConnection(stream);
                }
            } catch (Exception ex) {
                LogVS(ex);
                throw;
            }