protected internal virtual RpcTcpConnection CreateConnection() { RpcTcpConnection connection = null; if (configuration.IsCipherSet) { RpcTcpConnectionEncrypted encryptedConnection = new RpcTcpConnectionEncrypted(innerTcpClient, this, configuration); encryptedConnection.SetCipher(configuration.CreateNewCipher()); connection = encryptedConnection; } else { connection = new RpcTcpConnection(innerTcpClient, this, configuration); } return(connection); }
internal virtual RpcTcpConnection CreateConnection() { RpcTcpConnection connection = null; if (configuration.IsCipherSet) { RpcTcpConnectionEncrypted encryptedConnection = CreateConnectionInternal <RpcTcpConnectionEncrypted>(() => new RpcTcpConnectionEncrypted(innerTcpServer, this, configuration)); encryptedConnection.SetCipher(configuration.CreateNewCipher()); connection = encryptedConnection; } else { connection = CreateConnectionInternal <RpcTcpConnection>(() => new RpcTcpConnection(innerTcpServer, this, configuration)); } return(connection); }