<i>TCP is preferred rather than UDP</i>
TCP is preferred if you want to know if it was received correctly. UDP is preferred if you don’t care if it’s received.
You might start coding a chat function with UDP. As long as the function works as well as you need, stick with it. If the messages aren’t critical, it probably doesn’t matter.
But if you really need to know that the message went through with no errors, then code to the full TCP protocol. If you already have it working with UDP, you can almost just add all of the extra pieces for TCP including error recovery.
UDP is simpler and easier than TCP. But it provides less certainty.
from what i have seen most of the time is tcp but i might be wrong too..so if others would comment would be great