microsoft-graph-comms-samples icon indicating copy to clipboard operation
microsoft-graph-comms-samples copied to clipboard

Local Media CommunicationsClient hangs on exit

Open ravriel opened this issue 5 years ago • 1 comments

Describe the issue An application with a local media CommuncationsClient hangs on exit and never terminates. Only if forcing exit with Environment.Exit() enables application termination.

The CommuncationsClient in application does nothing except initialization and termination.

Problem can be reproduced in the minimal application below.

I'm using the latest Microsoft.Graph.Communications.Calls.* packages version 1.2.0.791.

Code Snippet ` graphlogger.txt static void Main(string[] args) { var logger = new GraphLogger(name);

        var builder = new CommunicationsClientBuilder(name, appId, logger);

        var authProvider = new AuthenticationProvider(name, appId, appSecret, logger);

        builder.SetAuthenticationProvider(authProvider);

        IPAddress publicIpAddress = Dns.GetHostEntry(serviceFqdn).AddressList[0];

        builder.SetNotificationUrl(new Uri("https://dummy-notifurl"));

        builder.SetServiceBaseUrl(new Uri("https://dummy-serviceurl"));

        builder.SetMediaPlatformSettings(
            new MediaPlatformSettings
            {
                ApplicationId = appId,
                HostingEnvironmentConfiguration = HostingEnvironmentConfiguration.Default,
                MediaPlatformInstanceSettings = 
                    new MediaPlatformInstanceSettings
                    {
                        CertificateThumbprint = cert,
                        ServiceFqdn = serviceFqdn,
                        InstancePublicPort = publicPort,
                        InstanceInternalPort = internalPort,
                        InstancePublicIPAddress = publicIpAddress,
                    },
            });

        var client = builder.Build();

        client.TerminateAsync().Wait();
        client.Dispose();

        // Uncomment line below to enable application exit
        // Environment.Exit(0);
    }

`

Expected behavior Successful termination

Graph SDK (please complete the following information): 1.2.0.791.

Call ID Provide the list call ids that encountered this issue. Include the time in UTC/GMT when these call have occurred.

Logs See attached.

Additional context Add any other context about the problem here.

ravriel avatar Apr 01 '20 13:04 ravriel

I encountered the same issue.

KanaHayama avatar May 05 '23 03:05 KanaHayama