Exemple #1
0
        private void Server_NewSessionConnected(CrmSocketSession session)
        {
            if (session.IsUnKnowScoket)
            {
                session.Close(CloseReason.SocketError);
            }

            CrmSocketConnManager.Connect(session);
        }
Exemple #2
0
 private void Server_NewMessageReceived(CrmSocketSession session, string value)
 {
     if (value == CrmSocketServer.HEARTBEAT)
     {
         CrmSocketConnManager.HeartBeat(session);
         session.SendJsonMessage("MSG", "SocketIsConnected");
         // 心跳信息不处理
         return;
     }
     session.SendJsonMessage("MSG", $"ServerRecivedMsg{value}");
 }
Exemple #3
0
        protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            var session = GridView1.Rows[e.RowIndex].Cells[0].Text;

            if (string.IsNullOrEmpty(session) == false)
            {
                CrmSocketConnManager.ShutDown(session, "管理员强制下线");
            }

            DataBind1();
            //string strUid = GridView1.Rows[e.RowIndex].Cells[0].Text;
            //CrmSocketSession users = new CrmSocketSession() { Uid = strUid };
            //context.User.Attach(users);
            //context.User.Remove(users);
            //context.SaveChanges();
            //DataBind();
        }
 public bool HasLogged(string account, string ip)
 {
     return(CrmSocketConnManager.CheckSingleLogin(account, ip));
 }
Exemple #5
0
 private void Server_SessionClosed(CrmSocketSession session, CloseReason value)
 {
     CrmSocketConnManager.DisConnection(session, value);
 }