Azure / azure-relay-dotnet

☁️ .NET Standard client library for Azure Relay Hybrid Connections
https://docs.microsoft.com/en-us/azure/service-bus-relay/relay-what-is-it
MIT License
35 stars 32 forks source link

Are HybridConnectionListeners allowed to Ping? #103

Open dlstucki opened 5 years ago

dlstucki commented 5 years ago

@dlstucki I'm creating an AzureListener, the connection is established sucessfully, but when I send Websocket Ping to azure relay server, the control connection is disconnected by the server.

Am I doing something wrong ?

I also debugged with the official azure relay sample: https://github.com/Azure/azure-relay/tree/master/samples/hybrid-connections/dotnet/simple-websocket/Server

After the connection is established, it seems that the listener never sends a Ping to the azure relay server, but the server just send Pong to the listener every 210 seconds(from wireshark).

Any comments ?

Originally posted by @Neilpang in https://github.com/MicrosoftDocs/azure-docs/issues/20479#issuecomment-483188173

priyaananthasankar commented 1 year ago

+1 on this Relay question. Is there sample code on how the listener can be kept alive through pings? Is this something the relay SDK code internally handles? Also does KeepAliveInterval handle these internal pings?

shankarsama commented 1 year ago

@priyaananthasankar, Yes, by setting KeepAliveInternal property on HybridConnectionListener https://github.com/Azure/azure-relay-dotnet/blob/8ed723837851890b0e4a0c1e60fbc5742424b5b5/src/Microsoft.Azure.Relay/HybridConnectionListener.cs#L255 Please let me know if you see any issues with this.

@spelluru, Can we improve the documentation for this? https://learn.microsoft.com/en-us/azure/azure-relay/relay-hybrid-connections-protocol#ping-operation