Hello all, I have developed a chat client and now I'd like to add file transfer capability to it. Here are some of the thoughts I've had with respect to I should go about implementing this.
1. Do I need additional sockets ONLY for the sake of transfering files?(i.e. reading/writing to an extra socket)
2. Do I need additional threads to handle this task? If so, should I construct a new socket or I'd be better off with the URL/URLConnection classes?
Thank you very much for you're help.
Joined: May 26, 2004
IMHO it would be better if youcould reuse the chat socket for file transfer. If it's not possible open a new socket for file transfer and close it immediately. The proble with the second socket is that your application will consume another socket on the client side and limit the number of clients that can be serviced simultaneously.
If you decide to use a second socket most likely you'll want to spawn a second thread. If not does your network layer allow you to send the file and chat at the same time?