c# - Send message to specific user -
i'm trying send user connects welcome message, won't work:
public void connected(string name) { clients.this.newmessage("hello world!"); //welcome message current user clients.all.userconnected(name); //joined message }
i know it's not lot of information give you, don't know need. (my front end angularjs, might useful)
you can
public override task onconnected() { string name = context.user.identity.name; groups.add(context.connectionid, name); clients.group(name).newmessage("hello world!"); //welcome message current user return base.onconnected(); }
Comments
Post a Comment