示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ClientHandler" /> class.
 /// </summary>
 /// <param name="datahandler">The data handler.</param>
 /// <param name="address">The IP address of the server.</param>
 public ClientHandler(DataHandler datahandler, string address)
 {
     this.memory = string.Empty;
     this.handler = datahandler;
     client = new Client(new CallBackDelegate(this.ResultCallBack), address);
     Thread t = new Thread(new ThreadStart(client.StartClient));
     t.Start();
 }
示例#2
0
 public void ConnectionTest()
 {
     MainThing server = new MainThing();
     server.Main();
     Handler handler = new Handler(Map.Instance());
     DataHandler dataHandler = new DataHandler(Map.Instance());
     CallBackClass client = new CallBackClass(handler, dataHandler);
     int currentTime = DateTime.Now.Millisecond;
     while (DateTime.Now.Millisecond - currentTime < 10000 && !AsynchronousSocketListener.hasConnection())
     {
     }
     Assert.True(AsynchronousSocketListener.hasConnection());
 }
示例#3
0
        /// <summary>
        /// Button click on start
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
        public void ButtonStart(object sender, RoutedEventArgs e)
        {
            this.address = this.GetIP();
            this.internetProtocolHandler.SaveIpToFile(this.IpAdressText.Text);

            this.map = Map.Instance();
            this.dataHandler = new DataHandler(this.map);
            ClientHandler c = new ClientHandler(this.dataHandler, this.address);
            this.map.Show();
            this.Hide();
            this.Close();
        }
示例#4
0
 public void setUp()
 {
     DataHandler dHandler = new DataHandler(Map.Instance());
     cHandler = new ClientHandler(dHandler, "127.0.0.1");
 }
示例#5
0
 public void SetUp()
 {
     map = Map.Instance();
     handler = new DataHandler(map);
 }