
SignalR & Real-time
SignalR hubs, WebSockets, Server-Sent Events, connection management, scaling, performance
1What is a Hub in SignalR?
What is a Hub in SignalR?
Risposta
A Hub is a class that serves as the central communication point between the server and connected clients. It allows invoking methods on the client side from the server and vice versa. Hubs automatically handle connection, disconnection, and message routing between connected clients. They inherit from the Hub class provided by SignalR and expose public methods that clients can call.
2How to create a strongly-typed Hub in SignalR?
How to create a strongly-typed Hub in SignalR?
Risposta
A strongly-typed Hub inherits from Hub<T> where T is an interface defining client methods. This provides IntelliSense and type checking when calling client methods via Clients.All, Clients.Caller, etc. The interface defines the contract of methods the server can invoke on clients. This approach reduces runtime errors by catching typing issues at compile time.
3What is the difference between Clients.All and Clients.Others in a SignalR Hub?
What is the difference between Clients.All and Clients.Others in a SignalR Hub?
Risposta
Clients.All sends the message to all connected clients, including the client that triggered the call. Clients.Others excludes the calling client and only sends the message to other connected clients. Using Clients.Others is useful for scenarios like broadcasting notifications where the emitting client doesn't need to receive its own message. Clients.Caller allows sending only to the calling client.
How to manage groups in SignalR to send messages to a subset of clients?
What transports are supported by SignalR and in what order are they negotiated?
+19 domande da colloquio
Altri argomenti di colloquio .NET
C# Basics
LINQ & Delegates
C# Language Essentials
ASP.NET Core Fundamentals
ASP.NET Core Request Lifecycle
Configuration & Settings
Application Lifecycle
Dependency Injection
Entity Framework Core
Minimal APIs
Web API Development
Async in ASP.NET Core
Authentication & Authorization
HttpClient & Networking
JSON Serialization
Entity Framework Core Advanced
C# Advanced Features
Clean Architecture
Logging, Monitoring & Observability
Unit Testing & xUnit
Integration Testing
Docker & Containerization
NuGet Package Management
Memory Management & GC
Reactive Programming
Async/await & Patterns
.NET Design Patterns
Performance Optimization
Security & Best Practices
Microservices Architecture
Padroneggia .NET per il tuo prossimo colloquio
Accedi a tutte le domande, flashcards, test tecnici, esercizi di code review e simulatori di colloquio.
Inizia gratis