Note that there are some explanatory texts on larger screens.

plurals
  1. POUDP Connection Between Client and Server
    primarykey
    data
    text
    <p>Here is the server code of my program this is working, but after it sends data it gets stuck. I need it to be refreshed and ready for sending data again.</p> <p>Server code:</p> <pre><code>private void button1_Click(object sender, EventArgs e) { try { String text = textBox1.Text; UdpClient udpc = new UdpClient(text,8899); IPEndPoint ep = null; while (true) { MessageBox.Show("Name: "); string name = textBox2.Text; if (name == "") break; byte[] sdata = Encoding.ASCII.GetBytes(name); udpc.Send(sdata, sdata.Length); if (udpc.Receive(ref ep)==null) { MessageBox.Show("Host not found"); } else { byte[] rdata = udpc.Receive(ref ep); string job = Encoding.ASCII.GetString(rdata); MessageBox.Show(job); } } } catch { MessageBox.Show("Error Restarting"); } </code></pre> <p>Client code:</p> <pre><code>private void button1_Click(object sender, EventArgs e) { try { UdpClient subscriber = new UdpClient(8899); IPAddress addr = IPAddress.Parse("127.0.0.2"); subscriber.JoinMulticastGroup(addr); IPEndPoint ep = null; for (int i = 0; i &lt; 1; i++) { byte[] pdata = subscriber.Receive(ref ep); string strdata = Encoding.ASCII.GetString(pdata); MessageBox.Show(strdata); textBox1.Text = strdata; pass = strdata; } subscriber.DropMulticastGroup(addr); } catch { Refresh(); MessageBox.Show("Not Found"); } } </code></pre> <p>The Server can send data to one client . <strong>I want to send one client at a time.</strong> But after sending the data, the server gets stuck. </p> <p>I need it do refresh and send data again for a client.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload