TcpClient and HttpWebRequest

  • Thread starter Thread starter Yair Nissan
  • Start date Start date
Y

Yair Nissan

Hi all,

I have an application which uses HttpWebRequest to get data from other
sites. I'm trying to convert the application to use TcpClient (or Socket)
since I need to bind the connection to a local endpoint for each request.

Is there a component which performs all the tasks that the HttpWebRequest
performs but enables me to bind each request to a local endpoint or a link
to a code sample that would explain how to do so.

Thanks,
Daniel
 
Yair Nissan said:
Hi all,

I have an application which uses HttpWebRequest to get data from other
sites. I'm trying to convert the application to use TcpClient (or Socket)
since I need to bind the connection to a local endpoint for each request.

Is there a component which performs all the tasks that the HttpWebRequest
performs but enables me to bind each request to a local endpoint or a link
to a code sample that would explain how to do so.

In .NET 2.0 the ServicePoint has a method to manually assign the local
endpoint:

ServicePoint.BindIPEndPointDelegate
http://msdn2.microsoft.com/en-us/library/system.net.servicepoint.bindipendpointdelegate.aspx

In .NET 1.1 you'll need to reimplement HTTP yourself. As a hint, try using
HTTP 1.0. It's substantially easier to implement from scratch than HTTP
1.1.

David
 
Back
Top