예제 #1
0
        /// <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)));
        }
예제 #2
0
        /// </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)));
        }