views:

12

answers:

0

I have a TCP server responsible for handling requests and I have a web server need to send request to TCP server and TCP server forward that request and after handling, send response to web server Im using Socket for communication between web server and tcp server I want to know which one of the following is best practice? and why?

1) Connect to tcp server, socket is always open and everything is handled on this socket
2) Connect to tcp server, after receiving the response from the server close the socket

Please note that web server is sending hundreds of request to tcp server in seconds.