Esempio n. 1
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);
        }
Esempio n. 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);
            }
        }