示例#1
0
        public GlobalHost(ActionSyncronizerProxy processQueue_, IPAddress myIP, TimerThread tt)
        {
            this.myIP    = myIP;
            this.tt      = tt;
            processQueue = processQueue_;
            log          = MasterLog.GetFileLog("network", "globalhost.log");

            StartListening();
        }
示例#2
0
        public Aggregator(IPAddress myIP, Func <WorldInitializer, World> generateWorld)
        {
            sync     = new ActionSyncronizer();
            host     = new GlobalHost(sync.GetProxy(), myIP, sync.TimedAction);
            myClient = new Client(host, this, generateWorld);

            ILog statsLog = MasterLog.GetFileLog("stats.log");

            sync.TimedAction.AddAction(() => Log.EntryNormal(statsLog, this.GetStats()));
        }
示例#3
0
        public OverlayHost(OverlayHostName hostName, IPEndPoint address, ActionSyncronizerProxy processQueue,
                           ProcessorAssigner messageProcessorAssigner, MemoryStream extraHandshakeInfo,
                           TimerThread tt, TimeSpan inactivityPeriod)
        {
            this.inactivityPeriod  = inactivityPeriod;
            this.hostName          = hostName;
            this.IpAddress         = address;
            this.processQueue      = processQueue;
            this.processorAssigner = messageProcessorAssigner;

            this.extraHandshakeInfo = extraHandshakeInfo;

            log = MasterLog.GetFileLog("network", hostName.ToString() + ".log");

            tt.AddAction(this.DisconnectInactiveNodes);
        }
示例#4
0
        public Node(Handshake info_, ActionSyncronizerProxy actionQueue_, DisconnectProcessor processDisonnect_)
        {
            info            = info_;
            sync            = actionQueue_;
            notifyDisonnect = processDisonnect_;

            writerStatus = WriteStatus.READY;
            readerStatus = ReadStatus.READY;
            IsClosed     = false;

            if (MasterLog.LogLevel > 1)
            {
                LogR = MasterLog.GetFileLog("network", info.local.hostname.ToString(),
                                            info.remote.ToString().Replace(':', '.') + " read.xml");

                LogW = MasterLog.GetFileLog("network", info.local.hostname.ToString(),
                                            info.remote.ToString().Replace(':', '.') + " write.xml");
            }

            UpdateUseTime();
        }