Пример #1
0
        public Master(Dictionary <int, string> slaves, UserStorageService service)
        {
            if (ReferenceEquals(service, null))
            {
                service = new UserStorageService();
            }

            this.service = service;
            this.slaves  = slaves;
        }
Пример #2
0
        public Slave(int port, string ip, UserStorageService service)
        {
            if (ReferenceEquals(service, null))
            {
                service = new UserStorageService();
            }

            this.service = service;
            this.IPAddr  = ip;
            this.Port    = port;
            count++;

            Task.Run(() => this.CreateServer());
        }