Esempio n. 1
0
        public Connection(Node owner, Configuration.Member remoteIdentifier) : base(owner)
        {
            this.owner            = owner;
            this.RemoteIdentifier = remoteIdentifier;
            LastIncoming          = DateTime.Now;

            serialLock = new DebugMutex("Consensus.Connection[" + RemoteIdentifier + "]");
        }
Esempio n. 2
0
        public Interface(Configuration.Member self, Address selfAddress, Int3 myCoords, ThreadOperations threadOps, INotifiable notify, Action <Address> onAddressBound = null) : base(self)
        {
            Notify    = notify;
            ThreadOps = threadOps;
            var cfg = BuildConfig();

            if (!cfg.ContainsIdentifier(self))
            {
                throw new ArgumentOutOfRangeException("Given self address is not contained by current SD configuration");
            }
            Log.Message("Starting consensus with configuration " + cfg);
            actualPort = Start(cfg, selfAddress, onAddressBound);
            MyID       = new ShardID(myCoords, self.Identifier);
            if (threadOps != ThreadOperations.Nothing)
            {
                gecThread = new Thread(new ThreadStart(GECThreadMain));
                gecThread.Start();
            }
        }
Esempio n. 3
0
 public Node(Configuration.Member self) : base(null)
 {
     MemberID   = self;
     serialLock = new DebugMutex("Consensus.Node[" + self + "]");
 }
Esempio n. 4
0
 public Connection(Node owner, Configuration.Member remoteIdentifier, TcpClient client) : this(owner, remoteIdentifier)
 {
     Assign(client, null);
     endPoint = client.Client.RemoteEndPoint;
 }
Esempio n. 5
0
 public ActiveConnection(Node owner, Configuration.Member remoteMember) : base(owner, remoteMember)
 {
     Connect();
 }