S
Sherif ElMetainy
Hello
I am writing a HTTP client, that will run on a computer with multiple IP
addresses. I want to bind the TCP socket for the HTTP connection to a
specific IP address, but unfortunately there is no option to do this in
System.Net.HttpWebRequest class. I looked for that option a lot, I even
looked at the ROTOR source code to if there is a private member that I can
access with reflection but didn't find anything. (I know this is not right
because internal implementation may change in the future, but I am
desperate)
I couldn't find HTTP clients for .NET that provide this option, and I have
no time to implement my own. I think this is a design flaw, that makes the
developer reimplement a whole set of classes in order to make such a minor
modification.
I suggest adding an event that it fired after the creation of the TCP socket
and before the connection is established so that the user can bind to a
localaddress or set other socket options, or even better a socket factory
class ( a class responsible for creating sockets for all connections
(HTTP/FTP/SMTP etc)) and a configuration option so that the user can provide
his/her own socket factory class.
Best regards,
Sherif
I am writing a HTTP client, that will run on a computer with multiple IP
addresses. I want to bind the TCP socket for the HTTP connection to a
specific IP address, but unfortunately there is no option to do this in
System.Net.HttpWebRequest class. I looked for that option a lot, I even
looked at the ROTOR source code to if there is a private member that I can
access with reflection but didn't find anything. (I know this is not right
because internal implementation may change in the future, but I am
desperate)
I couldn't find HTTP clients for .NET that provide this option, and I have
no time to implement my own. I think this is a design flaw, that makes the
developer reimplement a whole set of classes in order to make such a minor
modification.
I suggest adding an event that it fired after the creation of the TCP socket
and before the connection is established so that the user can bind to a
localaddress or set other socket options, or even better a socket factory
class ( a class responsible for creating sockets for all connections
(HTTP/FTP/SMTP etc)) and a configuration option so that the user can provide
his/her own socket factory class.
Best regards,
Sherif