예제 #1
0
        /// <summary>Snippet for UpdateConnectionCredential</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void UpdateConnectionCredential()
        {
            // Create client
            ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.Create();
            // Initialize request argument(s)
            string name = "";
            ConnectionCredential credential = new ConnectionCredential();

            // Make the request
            connectionServiceClient.UpdateConnectionCredential(name, credential);
        }
예제 #2
0
        /// <summary>Snippet for UpdateConnectionCredentialAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task UpdateConnectionCredentialAsync()
        {
            // Create client
            ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync();

            // Initialize request argument(s)
            string name = "";
            ConnectionCredential credential = new ConnectionCredential();
            // Make the request
            await connectionServiceClient.UpdateConnectionCredentialAsync(name, credential);
        }
예제 #3
0
        public void SendConnectionCredential(ConnectionCredential connectionCredentials)
        {
            var modifiedConnectionCredentialToAdd = new ModifiedConnectionCredential
            {
                ComputerName = connectionCredentials.ComputerName,
                OtherName    = connectionCredentials.OtherName,
                ConnectionId = Context.ConnectionId,
                LastReceivedSignalDateTime = DateTime.Now
            };

            _modifiedConnectionCredentials.Add(modifiedConnectionCredentialToAdd);
        }
        /// <summary>
        /// Servere bağlanmak için kullanılır.
        /// </summary>
        /// <param name="connectionCredentials"></param>
        /// <returns></returns>
        public async Task ConnectAsync(ConnectionCredential connectionCredentials)
        {
            _connectionCredentials = connectionCredentials;

            await _hubConnection.StartAsync();

            await SendConnectionCredentials(connectionCredentials);

            this.SendSignalLoop();

            Console.WriteLine("Sunucuya bağlantı sağlandı. Herhangi birşey yapmanıza gerek yok.");
        }
        /// <summary>Snippet for UpdateConnectionCredential</summary>
        public void UpdateConnectionCredential()
        {
            // Snippet: UpdateConnectionCredential(string, ConnectionCredential, CallSettings)
            // Create client
            ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.Create();
            // Initialize request argument(s)
            string name = "";
            ConnectionCredential credential = new ConnectionCredential();

            // Make the request
            connectionServiceClient.UpdateConnectionCredential(name, credential);
            // End snippet
        }
        /// <summary>Snippet for UpdateConnectionCredentialAsync</summary>
        public async Task UpdateConnectionCredentialAsync()
        {
            // Snippet: UpdateConnectionCredentialAsync(string, ConnectionCredential, CallSettings)
            // Additional: UpdateConnectionCredentialAsync(string, ConnectionCredential, CancellationToken)
            // Create client
            ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync();

            // Initialize request argument(s)
            string name = "";
            ConnectionCredential credential = new ConnectionCredential();
            // Make the request
            await connectionServiceClient.UpdateConnectionCredentialAsync(name, credential);

            // End snippet
        }
        static async Task Main(string[] args)
        {
            CheckSettings();

            HubManager connector = new HubManager(_clientSettings.HostUrl);

            var connectionCredentials = new ConnectionCredential()
            {
                ComputerName = _clientSettings.ComputerName,
                OtherName    = _clientSettings.OtherName
            };

            Console.Title = $"{connectionCredentials.OtherName} adıyla bağlandı.";

            await connector.ConnectAsync(connectionCredentials);

            Console.ReadKey();
        }
 /// <summary>
 /// Client Server'a ConnectionCredential nesnesini, Server'in Clienti daha detaylı tanıması için gönderir.
 /// </summary>
 /// <param name="connectionCredentials"></param>
 /// <returns></returns>
 private async Task SendConnectionCredentials(ConnectionCredential connectionCredentials)
 {
     await _hubConnection.SendAsync("SendConnectionCredential", connectionCredentials);
 }