java - problem about socket!(client/server) -


i can not why uses 2 different socket please me thanks.

the client request file through socket 9123 server, server send file client through socket 8123 on every client listening once requests file.

you need explain better that...

  • does each client listen on udp port 8123 , server supposed communicate @ once - if so, that's udp socket , don't have guarantee clients receive file.

  • does each client listen on tcp port 8123 (so server has connect again client asked file in first place?) - not idea, because have client-server connection established (on port 9123 - technically though, once accept() connection in server, communication moves 9123 open high port) - need spawn thread send file , server socket can keep accepting connections other clients. if must receive requests on 1 port , send files on (why?), create new socket after receiving request, connect client, , send file through - need consider why implementing that.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -