how can i send the data with the help of BeginSendTo function in UDP
<p>Actually i am quite new in UDP programming so i am not understanding how to use the BeginSendTo function....i have made a socket initiated all the relevant which is needed to make an connection then i used a array name buffer where i want to store my data..</p>

<p>Here is the sample of my code :-</p>

<pre><code>public partial class Form1 : Form

{

byte[] buffer = new byte[10];

IPEndPoint endpoint = new IPEndPoint(IPAddress.Loopback, 1235);        

Socket newsocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);

IPEndPoint sen = new IPEndPoint(IPAddress.Loopback, 5001);

newsocket.Bind(endpoint);

EndPoint tmp = (EndPoint)sen;

 protected void SendCallback(IAsyncResult ar)

{

try

 {

Socket socket = (Socket)ar.AsyncState;

for (int i = 0; i &lt; 6; i++)

{

buffer[i] = (Byte)uLC.getADC(i);    // this is the function i am storing the values in to buffer array

}


}

catch (Exception err)

{

MessageBox.Show(err.ToString());

 }

}
 private void button1_Click(object sender, EventArgs e)

{ 

 timer1.Enabled = true;

timer1.Interval = 2000;

timer1.Start();

}

private void timer1_Tick(object sender, EventArgs e)
        {

newsocket.BeginSendTo(buffer, 0, 7, SocketFlags.None, tmp, new AsyncCallback(SendCallback),newsocket);

}
</code></pre>

<p>I am not able to send the data..</p>
