private void EndSendMessage(bool succeeded, int count, object state)
        {
            PeerId id = (PeerId)state;

            if (!succeeded)
            {
                CleanupSocket(id, "Could not send message");
                return;
            }

            try
            {
                // Invoke the callback which we were told to invoke after we sent this message
                id.MessageSentCallback(id);
            }
            catch (Exception)
            {
                CleanupSocket(id, "Could not send message");
            }
        }