@@ -316,7 +316,12 @@ public static async Task<Tuple<UdpConnection, ConnectionResult>> CreateSecureUdp
316
316
/// Creates a new instance of a connection container.
317
317
/// </summary>
318
318
/// <returns>ConnectionContainer.</returns>
319
- public static ClientConnectionContainer CreateClientConnectionContainer ( string ipAddress , int port ) => new ClientConnectionContainer ( ipAddress , port ) ;
319
+ public static ClientConnectionContainer CreateClientConnectionContainer ( string ipAddress , int port )
320
+ {
321
+ var clientConnectionContainer = new ClientConnectionContainer ( ipAddress , port ) ;
322
+ clientConnectionContainer . Initialize ( ) ;
323
+ return clientConnectionContainer ;
324
+ }
320
325
321
326
/// <summary>
322
327
/// Creates a new instance of a secure-connection container. (RSA Encryption)
@@ -325,7 +330,12 @@ public static async Task<Tuple<UdpConnection, ConnectionResult>> CreateSecureUdp
325
330
/// <param name="keySize">The keySize.</param>
326
331
/// </summary>
327
332
/// <returns>ConnectionContainer.</returns>
328
- public static ClientConnectionContainer CreateSecureClientConnectionContainer ( string ipAddress , int port , string publicKey , string privateKey , int keySize = 2048 ) => new SecureClientConnectionContainer ( ipAddress , port , publicKey , privateKey , keySize ) ;
333
+ public static ClientConnectionContainer CreateSecureClientConnectionContainer ( string ipAddress , int port , string publicKey , string privateKey , int keySize = 2048 )
334
+ {
335
+ var secureClientConnectionContainer = new SecureClientConnectionContainer ( ipAddress , port , publicKey , privateKey , keySize ) ;
336
+ secureClientConnectionContainer . Initialize ( ) ;
337
+ return secureClientConnectionContainer ;
338
+ }
329
339
330
340
/// <summary>
331
341
/// Creates a new instance of a connection container.
@@ -338,7 +348,10 @@ public static ClientConnectionContainer CreateClientConnectionContainer(TcpConne
338
348
{
339
349
if ( tcpConnection == null || ! tcpConnection . IsAlive )
340
350
throw new ArgumentException ( "TCP connection must be connected to an endpoint." ) ;
341
- return new ClientConnectionContainer ( tcpConnection , udpConnection ) ;
351
+
352
+ var clientConnectionContainer = new ClientConnectionContainer ( tcpConnection , udpConnection ) ;
353
+ clientConnectionContainer . Initialize ( ) ;
354
+ return clientConnectionContainer ;
342
355
}
343
356
344
357
/// <summary>
@@ -355,7 +368,10 @@ public static ClientConnectionContainer CreateSecureClientConnectionContainer(Tc
355
368
{
356
369
if ( tcpConnection == null || ! tcpConnection . IsAlive )
357
370
throw new ArgumentException ( "TCP connection must be connected to an endpoint." ) ;
358
- return new SecureClientConnectionContainer ( tcpConnection , udpConnection , publicKey , privateKey , keySize ) ;
371
+
372
+ var secureClientConnectionContainer = new SecureClientConnectionContainer ( tcpConnection , udpConnection , publicKey , privateKey , keySize ) ;
373
+ secureClientConnectionContainer . Initialize ( ) ;
374
+ return secureClientConnectionContainer ;
359
375
}
360
376
361
377
/// <summary>
0 commit comments