Example #1
0
 public static NetworkBase getInstanceService(string host, int port)
 {
     if (s_instanceService == null)
     {
         s_instanceService = new NetworkBase(host, port);
     }
     return(s_instanceService);
 }
Example #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);
 }
Example #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;
        }
Example #4
0
 public static void ResetService()
 {
     s_instance.ResetServiceDelegate -= ResetService;
     s_instance = null;
 }