java - listener port and serving port in server -
i planing write 1 customized http
server in java. thought of using 1 listener port listen incoming calls. whenever incoming call come, accept , pass socket object in thread. thread responsible serving response. when response completed, closed. problem think if request comes @ time no more port available. thinking of having fixed number of serving port , reuse sending response back. can suggest how can in java?
you don't want limit ports as want limit threads, that's why many servers use threadpool
contains way less threads amount of available ports.
Comments
Post a Comment