Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update NamedPipeServer.cs #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions NamedPipeWrapper/NamedPipeServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,24 @@ public void PushMessage(TWrite message)
}
}
}

/// <summary>
/// Sends a message to all connected clients asynchronously.
/// This method returns immediately, possibly before the message has been sent to all clients.
/// </summary>
/// <param name="message"></param>
/// <param name="TargetCleintName">Send to a Target client</param>
public void PushMessage(TWrite message, string TargetCleintName)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling mistake in second parameter - should be TargetClientName

{
if (TargetCleintName == null)
throw new ArgumentNullException("TargetCleintName is null");

var client = _connections.Where(p => p.Name == TargetCleintName).SingleOrDefault();
if (client != null)
client.PushMessage(message);
else
throw new Exception("Is Not Exist TargetName");
}

/// <summary>
/// Closes all open client connections and stops listening for new ones.
Expand Down