Send Heartbeat to Server Every 60 seconds
<p>I would like to send an XML heartbeat to a server on 3547 every 60 seconds. The XML heartbeat looks like so:</p>

<pre><code>&lt;Heartbeat&gt;
    &lt;Unique_ID&gt;12345&lt;/Unique_ID&gt;
&lt;/Heartbeat&gt;
</code></pre>

<p>I should receive a response(ACK) from the server like:</p>

<pre><code>&lt;Heartbeat_ACK&gt;
    &lt;Unique_ID&gt;12345&lt;/Unique_ID&gt;
&lt;/Heartbeat_ACK&gt;
</code></pre>

<p>I use this code to listen for events coming in on port 3547:</p>

<pre><code>private void ListenForClients()
    {
        try
        {
            this.tcpListener.Start();

            while (true)
            {
                //blocks until a client has connected to the server
                TcpClient client = this.tcpListener.AcceptTcpClient();

                //create a thread to handle communicationwith connected client
                Thread clientThread = new Thread(new ParameterizedThreadStart(HandleClientComm));
                clientThread.Start(client);
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
        }
    }

    private void HandleClientComm(object client)
    {
        try
        {

            TcpClient tcpClient = (TcpClient)client;
            NetworkStream clientStream = tcpClient.GetStream();

            byte[] message = new byte[4096];
            int bytesRead;

            while (true)
            {
                bytesRead = 0;

                try
                {
                    //blocks until a client sends a message
                    bytesRead = clientStream.Read(message, 0, 4096);
                }
                catch
                {
                    //a socket error has occured
                    break;
                }

                if (bytesRead == 0)
                {
                    //the client has disconnected from the server
                    break;
                }

                //message has successfully been received
                ASCIIEncoding encoder = new ASCIIEncoding();
                System.Diagnostics.Debug.WriteLine(encoder.GetString(message, 0, bytesRead));
            }

            tcpClient.Close();
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
        }
    }
</code></pre>

<p>What code am I missing to receive the acknowledgement?</p>
