@@ -241,7 +241,6 @@ internal uint WritePacket(SNIHandle handle, SNIPacket packet, bool sync)
241
241
/// <summary>
242
242
/// Create a SNI connection handle
243
243
/// </summary>
244
- /// <param name="callbackObject">Asynchronous I/O callback object</param>
245
244
/// <param name="fullServerName">Full server name from connection string</param>
246
245
/// <param name="ignoreSniOpenTimeout">Ignore open timeout</param>
247
246
/// <param name="timerExpire">Timer expiration</param>
@@ -254,7 +253,7 @@ internal uint WritePacket(SNIHandle handle, SNIPacket packet, bool sync)
254
253
/// <param name="cachedFQDN">Used for DNS Cache</param>
255
254
/// <param name="pendingDNSInfo">Used for DNS Cache</param>
256
255
/// <returns>SNI handle</returns>
257
- internal SNIHandle CreateConnectionHandle ( object callbackObject , string fullServerName , bool ignoreSniOpenTimeout , long timerExpire , out byte [ ] instanceName , ref byte [ ] spnBuffer , bool flushCache , bool async , bool parallel , bool isIntegratedSecurity , string cachedFQDN , ref SQLDNSInfo pendingDNSInfo )
256
+ internal SNIHandle CreateConnectionHandle ( string fullServerName , bool ignoreSniOpenTimeout , long timerExpire , out byte [ ] instanceName , ref byte [ ] spnBuffer , bool flushCache , bool async , bool parallel , bool isIntegratedSecurity , string cachedFQDN , ref SQLDNSInfo pendingDNSInfo )
258
257
{
259
258
instanceName = new byte [ 1 ] ;
260
259
@@ -281,10 +280,10 @@ internal SNIHandle CreateConnectionHandle(object callbackObject, string fullServ
281
280
case DataSource . Protocol . Admin :
282
281
case DataSource . Protocol . None : // default to using tcp if no protocol is provided
283
282
case DataSource . Protocol . TCP :
284
- sniHandle = CreateTcpHandle ( details , timerExpire , callbackObject , parallel , cachedFQDN , ref pendingDNSInfo ) ;
283
+ sniHandle = CreateTcpHandle ( details , timerExpire , parallel , cachedFQDN , ref pendingDNSInfo ) ;
285
284
break ;
286
285
case DataSource . Protocol . NP :
287
- sniHandle = CreateNpHandle ( details , timerExpire , callbackObject , parallel ) ;
286
+ sniHandle = CreateNpHandle ( details , timerExpire , parallel ) ;
288
287
break ;
289
288
default :
290
289
Debug . Fail ( $ "Unexpected connection protocol: { details . _connectionProtocol } ") ;
@@ -365,12 +364,11 @@ private static byte[] GetSqlServerSPN(string hostNameOrAddress, string portOrIns
365
364
/// </summary>
366
365
/// <param name="details">Data source</param>
367
366
/// <param name="timerExpire">Timer expiration</param>
368
- /// <param name="callbackObject">Asynchronous I/O callback object</param>
369
367
/// <param name="parallel">Should MultiSubnetFailover be used</param>
370
368
/// <param name="cachedFQDN">Key for DNS Cache</param>
371
369
/// <param name="pendingDNSInfo">Used for DNS Cache</param>
372
370
/// <returns>SNITCPHandle</returns>
373
- private SNITCPHandle CreateTcpHandle ( DataSource details , long timerExpire , object callbackObject , bool parallel , string cachedFQDN , ref SQLDNSInfo pendingDNSInfo )
371
+ private SNITCPHandle CreateTcpHandle ( DataSource details , long timerExpire , bool parallel , string cachedFQDN , ref SQLDNSInfo pendingDNSInfo )
374
372
{
375
373
// TCP Format:
376
374
// tcp:<host name>\<instance name>
@@ -379,7 +377,7 @@ private SNITCPHandle CreateTcpHandle(DataSource details, long timerExpire, objec
379
377
string hostName = details . ServerName ;
380
378
if ( string . IsNullOrWhiteSpace ( hostName ) )
381
379
{
382
- SNILoadHandle . SingletonInstance . LastError = new SNIError ( SNIProviders . TCP_PROV , 0 , SNICommon . InvalidConnStringError , string . Empty ) ;
380
+ SNILoadHandle . SingletonInstance . LastError = new SNIError ( SNIProviders . TCP_PROV , 0 , SNICommon . InvalidConnStringError , Strings . SNI_ERROR_25 ) ;
383
381
return null ;
384
382
}
385
383
@@ -408,7 +406,7 @@ private SNITCPHandle CreateTcpHandle(DataSource details, long timerExpire, objec
408
406
port = isAdminConnection ? DefaultSqlServerDacPort : DefaultSqlServerPort ;
409
407
}
410
408
411
- return new SNITCPHandle ( hostName , port , timerExpire , callbackObject , parallel , cachedFQDN , ref pendingDNSInfo ) ;
409
+ return new SNITCPHandle ( hostName , port , timerExpire , parallel , cachedFQDN , ref pendingDNSInfo ) ;
412
410
}
413
411
414
412
@@ -418,17 +416,17 @@ private SNITCPHandle CreateTcpHandle(DataSource details, long timerExpire, objec
418
416
/// </summary>
419
417
/// <param name="details">Data source</param>
420
418
/// <param name="timerExpire">Timer expiration</param>
421
- /// <param name="callbackObject">Asynchronous I/O callback object</param>
422
419
/// <param name="parallel">Should MultiSubnetFailover be used. Only returns an error for named pipes.</param>
423
420
/// <returns>SNINpHandle</returns>
424
- private SNINpHandle CreateNpHandle ( DataSource details , long timerExpire , object callbackObject , bool parallel )
421
+ private SNINpHandle CreateNpHandle ( DataSource details , long timerExpire , bool parallel )
425
422
{
426
423
if ( parallel )
427
424
{
428
- SNICommon . ReportSNIError ( SNIProviders . NP_PROV , 0 , SNICommon . MultiSubnetFailoverWithNonTcpProtocol , string . Empty ) ;
425
+ // Connecting to a SQL Server instance using the MultiSubnetFailover connection option is only supported when using the TCP protocol
426
+ SNICommon . ReportSNIError ( SNIProviders . NP_PROV , 0 , SNICommon . MultiSubnetFailoverWithNonTcpProtocol , Strings . SNI_ERROR_49 ) ;
429
427
return null ;
430
428
}
431
- return new SNINpHandle ( details . PipeHostName , details . PipeName , timerExpire , callbackObject ) ;
429
+ return new SNINpHandle ( details . PipeHostName , details . PipeName , timerExpire ) ;
432
430
}
433
431
434
432
/// <summary>
@@ -632,7 +630,7 @@ internal static string GetLocalDBInstance(string dataSource, out bool error)
632
630
}
633
631
else
634
632
{
635
- SNILoadHandle . SingletonInstance . LastError = new SNIError ( SNIProviders . INVALID_PROV , 0 , SNICommon . LocalDBNoInstanceName , string . Empty ) ;
633
+ SNILoadHandle . SingletonInstance . LastError = new SNIError ( SNIProviders . INVALID_PROV , 0 , SNICommon . LocalDBNoInstanceName , Strings . SNI_ERROR_51 ) ;
636
634
error = true ;
637
635
return null ;
638
636
}
@@ -758,7 +756,7 @@ private bool InferConnectionDetails()
758
756
759
757
private void ReportSNIError ( SNIProviders provider )
760
758
{
761
- SNILoadHandle . SingletonInstance . LastError = new SNIError ( provider , 0 , SNICommon . InvalidConnStringError , string . Empty ) ;
759
+ SNILoadHandle . SingletonInstance . LastError = new SNIError ( provider , 0 , SNICommon . InvalidConnStringError , Strings . SNI_ERROR_25 ) ;
762
760
IsBadDataSource = true ;
763
761
}
764
762
0 commit comments