Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ch-hristov/e4c1bf4d62d2dcdae7def2d81dc45c17 to your computer and use it in GitHub Desktop.
Save ch-hristov/e4c1bf4d62d2dcdae7def2d81dc45c17 to your computer and use it in GitHub Desktop.
pipe listener
try
{
using (var server = new NamedPipeServerStream(_identifier.ToString()))
using (var reader = new StreamReader(server))
{
server.WaitForConnection();
var arguments = new List<String>();
while (server.IsConnected)
arguments.Add(reader.ReadLine());
ThreadPool.QueueUserWorkItem(CallOnArgumentsReceived, arguments.ToArray());
}
}
catch (IOException)
{ } //Pipe was broken
finally
{
ListenForArguments(null);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment