Пример #1
0
        private void Server_NewSessionConnected(CrmSocketSession session)
        {
            if (session.IsUnKnowScoket)
            {
                session.Close(CloseReason.SocketError);
            }

            CrmSocketConnManager.Connect(session);
        }
Пример #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}");
 }
Пример #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();
        }
Пример #4
0
 public bool HasLogged(string account, string ip)
 {
     return(CrmSocketConnManager.CheckSingleLogin(account, ip));
 }
Пример #5
0
 private void Server_SessionClosed(CrmSocketSession session, CloseReason value)
 {
     CrmSocketConnManager.DisConnection(session, value);
 }