Example #1
0
        public override void Initialize(string file)
        {
            Config.Configuration config = new Config.Configuration(file);
            protocol = (IProtocolParse)ObjectFactory.CreateInstance(config.Type);

            ip = config.IP;
            port = config.Port;
            server = new Server();
            server.OnReceive += new ReceiveEventHandler(server_OnReceive);
            time1 = new System.Timers.Timer();
            time1.Interval = 10000;
            dtTime = DateTime.Now;
            //time1.Elapsed += new System.Timers.ElapsedEventHandler(OnTimer);

            time1.Elapsed += new System.Timers.ElapsedEventHandler(time1_Elapsed);

            time1.Start();
        }
Example #2
0
 public ClientThread(Server server, Socket client)
 {
     this.server = server;
     this.socket = client;
     this.writer = new Writer(this.socket);
 }