Beispiel #1
0
        public GossipCluster(IGossipNodeConfig nodeConfig, IGossipClusterConfig clusterConfig)
        {
            if (nodeConfig == null) throw new ArgumentNullException("nodeConfig");
            if (clusterConfig == null) throw new ArgumentNullException("clusterConfig");

            NodeConfig = nodeConfig;
            ClusterConfig = clusterConfig;
        }
Beispiel #2
0
        public GossipNode(IGossipNodeConfig nodeConfig, IGossipClusterConfig clusterConfig)
        {
            if (nodeConfig == null) throw new ArgumentNullException("nodeConfig");

            NodeConfig = nodeConfig;
            Cluster = new GossipCluster(nodeConfig, clusterConfig);
            Cluster.OnNewMember += (c, m) => m.OnConnectionSuccess += (mem, conn) => conn.OnMessageReceived += (gc, msg) => OnMessageReceived(this, gc, msg);
            Authenticator = new GossipDefaultAuthenticator(clusterConfig.ClusterKey);

            if (nodeConfig.BindToEndPoint != null)
                _tcpListener = new TcpListener(nodeConfig.BindToEndPoint);
        }
        public GossipCluster(IGossipNodeConfig nodeConfig, IGossipClusterConfig clusterConfig)
        {
            if (nodeConfig == null)
            {
                throw new ArgumentNullException("nodeConfig");
            }
            if (clusterConfig == null)
            {
                throw new ArgumentNullException("clusterConfig");
            }

            NodeConfig    = nodeConfig;
            ClusterConfig = clusterConfig;
        }
Beispiel #4
0
        public GossipNode(IGossipNodeConfig nodeConfig, IGossipClusterConfig clusterConfig)
        {
            if (nodeConfig == null)
            {
                throw new ArgumentNullException("nodeConfig");
            }

            NodeConfig           = nodeConfig;
            Cluster              = new GossipCluster(nodeConfig, clusterConfig);
            Cluster.OnNewMember += (c, m) => m.OnConnectionSuccess += (mem, conn) => conn.OnMessageReceived += (gc, msg) => OnMessageReceived(this, gc, msg);
            Authenticator        = new GossipDefaultAuthenticator(clusterConfig.ClusterKey);

            if (nodeConfig.BindToEndPoint != null)
            {
                _tcpListener = new TcpListener(nodeConfig.BindToEndPoint);
            }
        }