Is it a specific local address:port that you need to use? Or do you just
want to ensure that all the requests are transmitted over the same TCP
connection to improve performance, by avoiding to create a new TCP
connection for each request?
Unless you are running on Windows Vista, your application cannot tell
WinHttp to use a specific local address:port. For Windows Vista, WinHttp
supports a new PORT_RESERVATION option which allows the app to specify the
local port range. See the MSDN documentation for details.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winhttp/http/option_flags.asp
If you just want all the requests (to the same remote server address:port)
to go over the same TCP connection, then WinHttp will try to do this
automatically if it can. By default, WinHttp prefers to reuse an existing
TCP connection (although there are scenarios in which it cannot); there is
nothing your app needs to do.
Regards,
Stephen
Post by CharleyWe are using HttpSendRequest to send multi requests to a WEB server. But we
have to use the same IP:PORT for the local address.
Does anyone know how to do it?