void ReceiveMsg(object o)
        {
            Socket client = o as Socket;

            void ipinfo()
            {
                byte[] buf = new byte[1024 * 1024];
                client.Receive(buf);
                Package package = BytesToPackage(buf);

                if (package.message == Messagetype.codeus)
                {
                    PackageToUserData packageToUserData = new PackageToUserData(NewUser);
                    int i = 0;
                    foreach (IPList ip in centerManager.UserList)
                    {
                        if (ip.ID == null)
                        {
                            Data.Userdata[i]        = packageToUserData(package);
                            Data.Userdata[i].IP     = client.RemoteEndPoint.ToString();
                            Data.Userdata[i].Live   = true;
                            Data.Userdata[i].socket = client;

                            centerManager.UserList[i].ID = Data.Userdata[i].ID;
                            centerManager.UserList[i].IP = client.RemoteEndPoint.ToString();
                            break;
                        }
                        i++;
                    }
                    //方法存留
                    Send(CreatIPListToPackage(Messagetype.codeus, centerManager.iplist), client);
                }
                else
                {
                    if (package.message == Messagetype.ID)
                    {
                        PackageToDeviceData packageToDeviceData = new PackageToDeviceData(NewDevice);

                        int i = 0;
                        foreach (IPList ip in centerManager.iplist)
                        {
                            if (ip.ID == null)
                            {
                                Data.Devicedata[i]        = packageToDeviceData(package);
                                Data.Devicedata[i].IP     = client.RemoteEndPoint.ToString();
                                Data.Devicedata[i].Live   = true;
                                Data.Devicedata[i].socket = client;

                                centerManager.iplist[i].ID = Data.Devicedata[i].ID;
                                centerManager.iplist[i].IP = client.RemoteEndPoint.ToString();
                                break;
                            }
                            i++;
                        }
                    }
                }
            }

            ipinfo();
        }
        void ReceiveMsg(object o)
        {
            Socket client = o as Socket;

            void ipinfo()
            {
                byte[] buf = new byte[1024 * 1024];

                client.Receive(buf);
                Package package = BytesToPackage(buf);

                if (package.message == Messagetype.codeus)
                {
                    ReceiveIPList(package);
                }
            }

            ipinfo();

            while (true)
            {
                try
                {
                    byte[]  buffer  = new byte[1024 * 1024];
                    int     n       = client.Receive(buffer);
                    Package package = BytesToPackage(buffer);
                    switch (package.message)
                    {
                    case Messagetype.package:
                        PackageToUserData packageToData = new PackageToUserData(NewUserData);
                        packageToData(package); break;

                    case Messagetype.carinfomessage:
                        PackageToUserData carinfomessageToData = new PackageToUserData(NewVolumeMessage);
                        carinfomessageToData(package); break;

                    case Messagetype.volumepackage:
                        PackageToUserData volumepackageToData = new PackageToUserData(NewVolumeMessage);
                        volumepackageToData(package); break;

                    case Messagetype.codeus: ReceiveIPList(package); break;
                    }
                }
                catch (Exception ex)
                {
                    NewMain.Nform.logClass.write(ex.Message);
                    connectflag = true;
                    break;
                }
            }
        }