/// <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(); }
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()); }
/// <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(); }
public void setUp() { DataHandler dHandler = new DataHandler(Map.Instance()); cHandler = new ClientHandler(dHandler, "127.0.0.1"); }
public void SetUp() { map = Map.Instance(); handler = new DataHandler(map); }