示例#1
0
 public static NetworkBase getInstanceService(string host, int port)
 {
     if (s_instanceService == null)
     {
         s_instanceService = new NetworkBase(host, port);
     }
     return(s_instanceService);
 }
示例#2
0
 public static NetworkBase getInstance()
 {
     if (s_instance == null)
     {
         s_instance = NetworkBase.getInstanceService(LocalDataModel.host, LocalDataModel.port);
         s_instance.ResetServiceDelegate += ResetService;
     }
     return(s_instance);
 }
示例#3
0
        public static void Reset()
        {
            if (s_instanceService == null)
            {
                return;
            }

            if (s_instanceService.ResetServiceDelegate != null)
            {
                s_instanceService.ResetServiceDelegate();
            }
            s_instanceService.InitSuccessDelegate    = null;
            s_instanceService.ConnectSuccessDelegate = null;
            s_instanceService.NetworkChangedDelegate = null;
            s_instanceService.LoginResponseDelegate  = null;

            s_instanceService.pclient.NetWorkStateChangedEvent -= s_instanceService.networkSatateChanged;
            s_instanceService.disconnect();
            s_instanceService.state = NetWorkState.DISCONNECTED;
            s_instanceService       = null;
        }
示例#4
0
 public static void ResetService()
 {
     s_instance.ResetServiceDelegate -= ResetService;
     s_instance = null;
 }