Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Should I use ServerSocket or DatagramSocket in my applications?

applications serversocket
0
Posted

Should I use ServerSocket or DatagramSocket in my applications?

0

DatagramSocket allows a server to accept UDP packets, whereas ServerSocket allows an application to accept TCP connections. It depends on the protocol you’re trying to implement. If you’re creating a new protocol, here’s a few tips • DatagramSockets communciate using UDP packets. These packets don’t guarantee delivery – you’ll need to handle missing packets in your client/server • ServerSockets communicate using TCP connections. TCP guarantees delivery, so all you need to do is have your applications read and write using a socket’s InputStream and OutputStream.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123