QUESTION
(a) You have been asked to design and implement a chat application. Which protocol would you used TCP or UDP? Justify your answer.
(b) Explain why multithreading is preferred to single thread in a client-server application?
(c) What is a socket? Why sockets are important? Why a port assignment is necessary during the creation of a socket?
(d) Explain how a client Socket is used in Java? Java codes may be used to your answer but they are not mandatory.
(e) Write a Java program to create a client based on TCP protocol. Add comments to your program to explain the instructions you are using.