@@ -20,9 +20,9 @@ public class XmlTransport : ITransport
2020 private const uint BatchSize = 100 ;
2121
2222 private readonly Uri endpoint ;
23+ private readonly HttpClient client ;
2324 private string username ;
2425 private string password ;
25- private Lazy < HttpClient > client ;
2626
2727 /// <summary>
2828 /// Initialize the transport with an alternate endpoint.
@@ -32,13 +32,13 @@ public class XmlTransport : ITransport
3232 /// <param name="username">The username assigned to the account on the given <paramref name="endpoint"/>.</param>
3333 /// <param name="password">The password assigned to the account on the given <paramref name="endpoint"/>.</param>
3434 /// <param name="endpoint">The alternate XML endpoint to use.</param>
35- /// <param name="messageHandler">Messagehandler used when sending xml</param>
36- public XmlTransport ( string username , string password , Uri endpoint , HttpMessageHandler messageHandler )
35+ /// <param name="client">HttpClient used when sending xml</param>
36+ public XmlTransport ( string username , string password , Uri endpoint , HttpClient client )
3737 {
3838 this . username = username ;
3939 this . password = password ;
4040 this . endpoint = endpoint ;
41- this . client = new Lazy < HttpClient > ( ( ) => new HttpClient ( messageHandler ) ) ;
41+ this . client = client ;
4242 }
4343
4444 /// <summary>
@@ -49,7 +49,7 @@ public XmlTransport(string username, string password, Uri endpoint, HttpMessageH
4949 /// <param name="username">The username assigned to the account on the given <paramref name="endpoint"/>.</param>
5050 /// <param name="password">The password assigned to the account on the given <paramref name="endpoint"/>.</param>
5151 /// <param name="endpoint">The alternate XML endpoint to use.</param>
52- public XmlTransport ( string username , string password , Uri endpoint ) : this ( username , password , endpoint , new HttpClientHandler ( ) )
52+ public XmlTransport ( string username , string password , Uri endpoint ) : this ( username , password , endpoint , new HttpClient ( ) )
5353 {
5454 }
5555
0 commit comments