How Web server handle TCP connection? -
i tring write small web server. , trying understand how web server should handle tcp connection.
my understanding is, client requests arrive @ web server on 80 port. web server has dedicated monitoring thread (or many?) listening on port 80. , monitoring thread put work item each of incoming requests queue later process. work item data should include client ip address , client port info.
then worker threads take requests queue , send responses clients. tcp connection tuple < server ip, port 80, client ip, client port >
so, question is,
can there more 1 monitoring threads? , there multiple queues or single queue synchronized access among multiple monitoring , worker threads?
can work items on queue have inter-relationship? if not, mean loss of state of subsequent requests?
is possible single port 80 used many worker threads create outbound connection? mean, port 80 used many server worker threads @ same time create tcp connection below. , these connections used sending responses different clients.
< server ip, port 80, client ip 1, client port 1 >
< server ip, port 80, client ip 2, client port 2 >
< server ip, port 80, client ip 3, client port 3 >
...
can there more 1 monitoring threads?
yes.
and there multiple queues or single queue synchronized access among multiple monitoring , worker threads?
whichever suits you.
can work items on queue have inter-relationship?
only if original requests do, how clients written.
if not, mean loss of state of subsequent requests?
does what mean loss of state?
is possible single port 80 used many worker threads create outbound connection?
no, workers don't create outbound connections. reply on same connection request received on.
Comments
Post a Comment