Azure / azure-relay-dotnet

☁️ .NET Standard client library for Azure Relay Hybrid Connections

Home Page:https://docs.microsoft.com/en-us/azure/service-bus-relay/relay-what-is-it

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Are HybridConnectionListeners allowed to Ping?

dlstucki opened this issue · comments

@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 MicrosoftDocs/azure-docs#20479 (comment)

+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?

@priyaananthasankar, Yes, by setting KeepAliveInternal property on HybridConnectionListener

public TimeSpan KeepAliveInterval { get; set; }

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