public async Task SendMessageToId(string text, string channelSlugUrl, string connectionId) { var data = new ReceiveSocketDataModel { ConnectionId = connectionId, MessageJson = new[] { text }, InvokeMethodName = "SendMessageToId", //System.Reflection.MethodBase.GetCurrentMethod().Name }; await EchoProcess.SendToClientConnectionId(channelSlugUrl, data); }
//[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] //public string GetCurrentMethod() //{ // System.Diagnostics.StackTrace st = new System.Diagnostics.StackTrace(); // System.Diagnostics.StackFrame sf = st.GetFrame(1); // return sf.GetMethod().Name; //} public override async Task OnConnectedAsync() { //var methodName = new StackTrace().GetFrame(2).GetMethod().Name; var methodName = nameof(this.OnConnectedAsync); #region Reply Connecttion Id var replyConnectionData = new ReceiveSocketDataModel { ConnectionId = Context.ConnectionId, ConnectionName = "", //todo set MessageJson = new[] { RegisWebSocketProcess.GetConnectionRegisListFromSlug(Context.ChannelSlugUrl) }, InvokeMethodName = methodName }; await EchoProcess.SendToClientConnectionId(Context.ChannelSlugUrl, replyConnectionData); #endregion //todo flush this to any client }