Example #1
0
        private void Socket_Add_UpdateUserinfo(WebSocket ws)
        {
            string ip   = System.Web.HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
            int    port = System.Convert.ToInt32(System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_PORT"]);

            if (string.IsNullOrEmpty(ip))
            {
                ip = System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
            }

            SC.IP       = ip;
            SC.Port     = port;
            SC.ws       = ws;
            SC.UserName = auth.UserName;
            SC.AuthKey  = auth.AuthKey;
            SC.Address  = auth.Address;

            Singleton Handler = Singleton.Instance;

            Handler.AddSocket(SC);
        }