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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -