SO has always considered comments as less important than questions/answers, right or wrong. This means that your comments can get deleted by a moderator or migrated to chat, for a lot of different reasons. Sometimes the reasons are strange and you don't agree with the mod, but if all that happened is a lost comment, it's not worth losing sleep over.
As for what appears to be your comment, re-posted in this thread by @Zoe (a moderator):
You'd have to provide a ton more detail to make this an answerable question. Do you already have the UDP server side written? If not, why even use UDP? Have you tried sending any data from your app to a basic server written from one of the many tutorials online?
I don't think there's any major problems with it, though "provide a ton more detail" may be considered unfriendly by some with too weak guts to be on the Internet in the first place. Similarly, recommending people to actually study the utter basics of something before attempting to use it, is frowned upon by some sensitive people.
(If you think this is unfriendly, for the love of kindness stay away from Reddit, Facebook, YouTube, etc., etc. Those kind of sensitive users who get offended by the sky being blue are unfortunately numerous.)
As for the racist comment, it is actually something that should be flagged under "harassment, bigotry and abuse". This would be a Code of Conduct violation and moderators will therefore also take disciplinary action against the user. Though that is done in a private context and you will never know what become of it, nor will the moderators comment on it.
So it is quite possible that both your comments were deleted for different reasons, but that some disciplinary action was taken against the user of the other comment.
Regarding the question you commented below, it is just completely non-salvageable. Since we get deadly tired of these kind of questions and the ever-declining quality of SO, it is very tempting to leave a comment about it... I do this all the time too. But it is often just best to downvote, close-vote and move on. Close as too broad in this specific case. Spend as little effort and energy on the question as possible. It is the person who asked it who needs to put in some effort.