/// <summary> /// Gets the interface the connection is using. /// </summary> /// <returns>The <see cref="ICommsInterface"/> which represents the interface the connection is using.</returns> public async Task <ICommsInterface> GetConnectedInterfaceAsync() { var ipEndpoint = (IPEndPoint)_backingTcpClient.Client.LocalEndPoint; var interfaces = await CommsInterface.GetAllInterfacesAsync(); return(interfaces.FirstOrDefault(x => x.NativeIpAddress.Equals(ipEndpoint.Address))); }
/// </summary> /// <returns>The <see cref="ICommsInterface"/> which represents the interface the connection is using.</returns> public async Task <ICommsInterface> GetConnectedInterfaceAsync() { var interfaces = await CommsInterface.GetAllInterfacesAsync(); return(interfaces.FirstOrDefault(x => x.NativeHostName.IsEqual(_backingStreamSocket.Information.LocalAddress))); }