当前位置: 首页>>代码示例>>Java>>正文


Java NetworkTopologyEvent.getInetAddress方法代码示例

本文整理汇总了Java中javax.jmdns.NetworkTopologyEvent.getInetAddress方法的典型用法代码示例。如果您正苦于以下问题:Java NetworkTopologyEvent.getInetAddress方法的具体用法?Java NetworkTopologyEvent.getInetAddress怎么用?Java NetworkTopologyEvent.getInetAddress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.jmdns.NetworkTopologyEvent的用法示例。


在下文中一共展示了NetworkTopologyEvent.getInetAddress方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: inetAddressRemoved

import javax.jmdns.NetworkTopologyEvent; //导入方法依赖的package包/类
@Override
public void inetAddressRemoved(NetworkTopologyEvent event) {
    InetAddress address = event.getInetAddress();
    try {
        synchronized (this) {
            if (_knownMDNS.containsKey(address)) {
                JmDNS mDNS = _knownMDNS.remove(address);
                mDNS.close();
                final NetworkTopologyEvent jmdnsEvent = new NetworkTopologyEventImpl(mDNS, address);
                for (final NetworkTopologyListener listener : this.networkListeners()) {
                    _ListenerExecutor.submit(new Runnable() {
                        /**
                         * {@inheritDoc}
                         */
                        @Override
                        public void run() {
                            listener.inetAddressRemoved(jmdnsEvent);
                        }
                    });
                }
            }
        }
    } catch (Exception e) {
        logger.warning("Unexpected unhandled exception: " + e);
    }
}
 
开发者ID:iilxy,项目名称:AndroidmDNS,代码行数:27,代码来源:JmmDNSImpl.java

示例2: inetAddressAdded

import javax.jmdns.NetworkTopologyEvent; //导入方法依赖的package包/类
@Override
public void inetAddressAdded(NetworkTopologyEvent event) {
    InetAddress address = event.getInetAddress();
    try {
        synchronized (this) {
            if (!_knownMDNS.containsKey(address)) {
                _knownMDNS.put(address, JmDNS.create(address));
                final NetworkTopologyEvent jmdnsEvent = new NetworkTopologyEventImpl(_knownMDNS.get(address), address);
                for (final NetworkTopologyListener listener : this.networkListeners()) {
                    _ListenerExecutor.submit(new Runnable() {
                        /**
                         * {@inheritDoc}
                         */
                        @Override
                        public void run() {
                            listener.inetAddressAdded(jmdnsEvent);
                        }
                    });
                }
            }
        }
    } catch (Exception e) {
        logger.warning("Unexpected unhandled exception: " + e);
    }
}
 
开发者ID:DeviceConnect,项目名称:DeviceConnect-Android,代码行数:26,代码来源:JmmDNSImpl.java

示例3: inetAddressRemoved

import javax.jmdns.NetworkTopologyEvent; //导入方法依赖的package包/类
@Override
public void inetAddressRemoved(NetworkTopologyEvent event) {
    InetAddress address = event.getInetAddress();
    try {
        if (_knownMDNS.containsKey(address)) {
            synchronized (_knownMDNS) {
                if (_knownMDNS.containsKey(address)) {
                    JmDNS mDNS = _knownMDNS.remove(address);
                    mDNS.close();
                    final NetworkTopologyEvent jmdnsEvent = new NetworkTopologyEventImpl(mDNS, address);
                    for (final NetworkTopologyListener listener : this.networkListeners()) {
                        _listenerExecutor.submit(new Runnable() {
                            /**
                             * {@inheritDoc}
                             */
                            @Override
                            public void run() {
                                listener.inetAddressRemoved(jmdnsEvent);
                            }
                        });
                    }
                }
            }
        }
    } catch (Exception e) {
        logger.warning("Unexpected unhandled exception: " + e);
    }
}
 
开发者ID:JMRI,项目名称:EngineDriver,代码行数:29,代码来源:JmmDNSImpl.java

示例4: inetAddressAdded

import javax.jmdns.NetworkTopologyEvent; //导入方法依赖的package包/类
@Override
public void inetAddressAdded(NetworkTopologyEvent event)
{
    InetAddress address = event.getInetAddress();
    try
    {
        synchronized (this)
        {
            if (!_knownMDNS.containsKey(address))
            {
                JmDNS mDNS = JmDNS.create(address);
                _knownMDNS.put(address, mDNS);
                final NetworkTopologyEvent jmdnsEvent = new NetworkTopologyEventImpl(mDNS, address);
                for (final NetworkTopologyListener listener : this.networkListeners())
                {
                    _ListenerExecutor.submit(new Runnable() {
                        /**
                         * {@inheritDoc}
                         */
                        @Override
                        public void run()
                        {
                            listener.inetAddressAdded(jmdnsEvent);
                        }
                    });
                }
            }
        }
    }
    catch (Exception e)
    {
        logger.warning("Unexpected unhandled exception: " + e);
    }
}
 
开发者ID:blackshadowwalker,项目名称:log4j-collector,代码行数:35,代码来源:JmmDNSImpl.java

示例5: inetAddressRemoved

import javax.jmdns.NetworkTopologyEvent; //导入方法依赖的package包/类
@Override
public void inetAddressRemoved(NetworkTopologyEvent event)
{
    InetAddress address = event.getInetAddress();
    try
    {
        synchronized (this)
        {
            if (_knownMDNS.containsKey(address))
            {
                JmDNS mDNS = JmDNS.create(address);
                _knownMDNS.remove(address);
                mDNS.close();
                final NetworkTopologyEvent jmdnsEvent = new NetworkTopologyEventImpl(mDNS, address);
                for (final NetworkTopologyListener listener : this.networkListeners())
                {
                    _ListenerExecutor.submit(new Runnable() {
                        /**
                         * {@inheritDoc}
                         */
                        @Override
                        public void run()
                        {
                            listener.inetAddressRemoved(jmdnsEvent);
                        }
                    });
                }
            }
        }
    }
    catch (Exception e)
    {
        logger.warning("Unexpected unhandled exception: " + e);
    }
}
 
开发者ID:blackshadowwalker,项目名称:log4j-collector,代码行数:36,代码来源:JmmDNSImpl.java


注:本文中的javax.jmdns.NetworkTopologyEvent.getInetAddress方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。