A client manages the connection to the server
Exemple #1
0
 public IXPRequest(Networking.Client client, IXPFile request, Action<string> responseDelegate)
 {
     _request = request;
     _responseDelegate = responseDelegate;
     _client = client;
     Thread thread = new Thread(new ThreadStart(Work));
     thread.Start();
 }
Exemple #2
0
        public Form1()
        {
            InitializeComponent();
            _client = new Networking.Client("127.0.0.1", 10250);
            _client.Connect();

            FormClosing += Form1_FormClosing;
        }
Exemple #3
0
 private void btnReconnect_Click(object sender, EventArgs e)
 {
     _client = new Client("127.0.0.1", 10250);
     if(_client.Connect()) {
         MessageBox.Show("Connected");
     } else {
         MessageBox.Show("Failed");
     }
 }
Exemple #4
0
 public static void Main(string[] args)
 {
     Client c = null;
     Server s = null;
     //Server s = new Server();
     if (args[0].Equals ("c")) {
         c = new Client (args[1].ToString (), Convert.ToInt32 (args[2]));
     } else if (args[0].Equals ("s")) {
         s = new Server ();
     }
 }
Exemple #5
0
 public FormMain()
 {
     InitializeComponent();
     _client = new Client("127.0.0.1", 10250);
     if (!_client.Connect()) {
         _client = null;
         return;
     }
     _client.Disconnected += Client_Disconnected;
     _client.MessageReceived += Client_MessageReceived;
     FormClosing += FormMain_FormClosing;
 }