user1192403
user1192403

Reputation: 647

Send and Read from a socket simultaneously

I'm working on a simple proxy server. The problem is browser sometimes re-uses the connection and sends multiple requests on the same connection.

I'm using TcpClient and Stream to make HTTP request to the server. How can I have read and write functions 'separate' from each other, like in separate threads for example. Thanks!

Upvotes: 0

Views: 255

Answers (1)

cgcoder
cgcoder

Reputation: 436

Its called persistent connection. If you don't want the browser to do that, you should not send this header "Connection: Keep-Alive" in your proxy response.

http://en.wikipedia.org/wiki/HTTP_persistent_connection

Upvotes: 2

Related Questions