Hello friends , Back here with some doubts again .. well i want to know what is the significance of non blocking sockets in the new java io package or rarther NIO ?? Can anyone tell me this ?? Hoping to hear from you soon , Thanks, Saurabh
Success is not doing extraordinary things but doing ordinary things extraordinarily well.
If you can do useful processing while waiting for more data to arrive over the network, non-blocking is a hnday way to just grab whatever data is available and continue processing. A more common use is in high-load servers. With blocking IO you need to spawn a new thread for each request which limits the number of simultanious request the server can handle and uses a lot of processor cycles switching back and forth between all the threads. With non-blocking IO you can handle massive converrency without massive thread creation and you can accomplish useful things during periods of lag from network latency instead of just waiting for packets.