You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm using System.MonitorEventsAsync and connecting to a tcp socket.
Sometimes the machine I'm connecting to is restarted and I lose connection, how can I detect this and reconnect?
privateasyncTaskStartDockerClient(CancellationTokencancellationToken){Credentialscredentials=null;if(dockerHostSettings.Usernameis not null&&dockerHostSettings.Passwordis not null){credentials=newDocker.DotNet.BasicAuth.BasicAuthCredentials(dockerHostSettings.Username,dockerHostSettings.Password,dockerHostSettings.UseTls);}client=newDockerClientConfiguration(endpoint:newUri(dockerHostSettings.Endpoint),credentials:credentials).CreateClient();varprogress=newProgress<Message>();progress.ProgressChanged+=Progress_ProgressChanged;IList<ContainerListResponse>containers=awaitclient.Containers.ListContainersAsync(newContainersListParameters(){Filters=newDictionary<string,IDictionary<string,bool>>(){{"status",newDictionary<string,bool>(){{"running",true}}},}});foreach(varitemincontainers){varcontainer=awaitGetContainer(item);if(containerisnull){continue;}await(ContainerStarted?.Invoke(container)??Task.CompletedTask);}client.System.MonitorEventsAsync(newContainerEventsParameters(),progress,cancellationToken);}
The text was updated successfully, but these errors were encountered:
Hi, I'm using System.MonitorEventsAsync and connecting to a tcp socket.
Sometimes the machine I'm connecting to is restarted and I lose connection, how can I detect this and reconnect?
The text was updated successfully, but these errors were encountered: