示例#1
0
文件: icSocket.cs 项目: jiagithub/PSS
        internal icSocket(AppClass App, string ConfigPath)
        {
            this.app = App;
            XmlDocument doc = new XmlDocument();
            doc.Load(ConfigPath + "Config.xml");
            XmlNodeList nodes = doc.GetElementsByTagName("Server");
            ip = nodes[0].Attributes.GetNamedItem("ip").InnerText;
            port = Convert.ToInt32(nodes[0].Attributes.GetNamedItem("port").InnerText);
            serverid = Convert.ToUInt16(nodes[0].Attributes.GetNamedItem("id").InnerText);
            XmlNodeList TimeOutnodes = doc.GetElementsByTagName("TimeOut");
            if (TimeOutnodes.Count > 0)
            {
                MinTimeOut = Convert.ToInt32(TimeOutnodes[0].Attributes.GetNamedItem("min").InnerText);
                MinNetSpeed = Convert.ToInt32(TimeOutnodes[0].Attributes.GetNamedItem("minnetspeed").InnerText);
            }

            sendouttimeThread = new Thread(sendouttimeThreadStart);
            sendThread = new Thread(sendThreadStart);
            recvThread = new Thread(recvThreadStart);
            heartThread = new Thread(heartThreadStart);
            sendThread.Priority = ThreadPriority.BelowNormal;
            sendThread.IsBackground = true;
            heartThread.Priority = ThreadPriority.Lowest;
            heartThread.IsBackground = true;
            recvThread.IsBackground = true;
            sendouttimeThread.IsBackground = true;
            sendouttimeThread.Priority = ThreadPriority.Lowest;
            heartThread.Start();
            sendThread.Start();
            recvThread.Start();
            sendouttimeThread.Start();
        }
示例#2
0
文件: icParse.cs 项目: jiagithub/PSS
 internal static byte[] makeRegPacket(AppClass App)
 {
     const int PacketHeadSize = 4;
     const int CommnadSize = 2;
     const int AppIDSize = 2;
     const int AppTypeSize = 2;
     const int StringSize = 4;
     UInt16 AppID = (UInt16)App.id;
     UInt16 AppType = (UInt16)App.type;
     byte[] appname = Encoding.ASCII.GetBytes(App.appname);
     int appnamel = appname.Length;
     int length = CommnadSize + AppIDSize + AppTypeSize + StringSize + appname.Length;
     byte[] p = new byte[PacketHeadSize + length];
     p[0] = (byte)(length);
     p[1] = (byte)(length >> 8);
     p[2] = (byte)(length >> 16);
     p[3] = (byte)(length >> 24);
     p[4] = unchecked((byte)(COMMAND_ID.COMMAND_REG));
     p[5] = (byte)((UInt16)COMMAND_ID.COMMAND_REG >> 8);
     p[6] = (byte)(AppID);
     p[7] = (byte)(AppID >> 8);
     p[8] = (byte)(AppType);
     p[9] = (byte)(AppType >> 8);
     p[10] = (byte)(appnamel );
     p[11] = (byte)(appnamel >> 8);
     p[12] = (byte)(appnamel >> 16);
     p[13] = (byte)(appnamel >> 24);
     appname.CopyTo(p, PacketHeadSize + CommnadSize + AppIDSize + AppTypeSize + StringSize);
     return p;
 }
示例#3
0
文件: Client.cs 项目: jiagithub/PSS
 internal Client(AppClass App, string ConfigPath)
 {
     this.binPath = ConfigPath;
     this.app = App;
     XmlDocument doc = new XmlDocument();
     doc.Load(binPath + "Config.xml");
     XmlNodeList nodes = doc.GetElementsByTagName("Connect");
     connectcount = Convert.ToInt32(nodes[0].Attributes.GetNamedItem("count").InnerText);
     XmlNodeList nodes2 = doc.GetElementsByTagName("Server");
     localserverid = Convert.ToUInt16(nodes2[0].Attributes.GetNamedItem("id").InnerText);
     ini();
 }
        internal Client(AppClass App, string ConfigPath)
        {
            this.binPath = ConfigPath;
            this.app     = App;
            XmlDocument doc = new XmlDocument();

            doc.Load(binPath + "Config.xml");
            XmlNodeList nodes = doc.GetElementsByTagName("Connect");

            connectcount = Convert.ToInt32(nodes[0].Attributes.GetNamedItem("count").InnerText);
            XmlNodeList nodes2 = doc.GetElementsByTagName("Server");

            localserverid = Convert.ToUInt16(nodes2[0].Attributes.GetNamedItem("id").InnerText);
            ini();
        }
示例#5
0
 internal ClientP2P(AppClass App, string ConfigPath)
     : base(App,ConfigPath)
 {
 }
示例#6
0
文件: ClientApp.cs 项目: zh423328/PSS
 internal ClientApp(AppClass App, string ConfigPath)
     : base(App, ConfigPath)
 {
 }
示例#7
0
 internal ClientMoniter(AppClass App, string ConfigPath)
     : base(App,ConfigPath)
 {
 }
 internal ClientAuthor(AppClass App, string ConfigPath)
     : base(App,ConfigPath)
 {
 }