Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save fagnercarvalho/c8997eb4d77fe91f803c to your computer and use it in GitHub Desktop.

Select an option

Save fagnercarvalho/c8997eb4d77fe91f803c to your computer and use it in GitHub Desktop.
2016-02-28-Omegle-clone-using-SignalR
public void Send(string message)
{
var user = this.Context.ConnectionId;
var chat = GetChatByUser(user);
if (chat == null)
{
return;
}
if (chat.User1 == user)
{
Clients.Client(chat.User2).receiveMessage(message);
}
else
{
Clients.Client(chat.User1).receiveMessage(message);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment