Hi to all......
How can we make udp socket behave as tcp means how to make udp as reliable,,,,,,if possible mention some code.
2-is it possible to create simple object if we have a constructor in private section,suppose class p1,p2.....not using static method or singleton pattern.
Thanx
The answer to question #1 is you can't easily. You have two options. One is to build reliability yourself above UDP. The second, and probably not useful to you, is to use SCTP, but depending on your OS, you might not even have kernel support for it.
UDP is not a reliable connection and was never designed to be- it is simply a best effort transport protocol. Your best bet is a TCP/IP socket if you want reliability.
You can make UDP behave like TCP. But you have to do this manually and handle the connection-orientated behavior within your code.
TCP is no different than UDP, except that it has a "driver" to handle connection information for you. You could easily write some code to do this manually yourself.