Register now or log in to join your professional community.
It is depends on what kind of data you want to transfer using UDP or TCP Socket.
UDP is a open protocol. Every information or data go through UDP does not wrapped and does not encrypted. That is why UDP is used for publicly available data. For example DNS, un-encrypted video or sound streaming for performance.
On the other hand TCP uses special wrapper to wrap all the data goes through TCP socket. You should use TCP socket if you need to transfer sensible information.
If you do not need UDP for some special reason, go with TCP. Because you will have more option in TCP Socket.
UDP is a low-overhead transmission and connectionless protocol. TCP is a high-reliability data transmission and connection oriented protocol. So TCP used for more sensitive data because it encrypts the data. UDP does not encrypt the data and it is connectionless protocol it is used for audio, video transmission for better performance of videos.