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


Java DNSConstants.MDNS_PORT属性代码示例

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


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

示例1: send

/**
 * Send an outgoing multicast DNS message.
 *
 * @param out
 * @exception IOException
 */
public void send(DNSOutgoing out) throws IOException {
    if (!out.isEmpty()) {
        byte[] message = out.data();
        final DatagramPacket packet = new DatagramPacket(message, message.length, _group, DNSConstants.MDNS_PORT);

        if (logger.isLoggable(Level.FINEST)) {
            try {
                final DNSIncoming msg = new DNSIncoming(packet);
                if (logger.isLoggable(Level.FINEST)) {
                    logger.finest("send(" + this.getName() + ") JmDNS out:" + msg.print(true));
                }
            } catch (final IOException e) {
                logger.throwing(getClass().toString(), "send(" + this.getName() + ") - JmDNS can not parse what it sends!!!", e);
            }
        }
        final MulticastSocket ms = _socket;
        if (ms != null && !ms.isClosed()) {
            ms.send(packet);
        }
    }
}
 
开发者ID:iilxy,项目名称:AndroidmDNS,代码行数:27,代码来源:JmDNSImpl.java

示例2: send

/**
 * Send an outgoing multicast DNS message.
 *
 * @param out
 * @throws java.io.IOException
 */
public void send(DNSOutgoing out) throws IOException
{
    if (!out.isEmpty())
    {
        byte[] message = out.data();
        final DatagramPacket packet = new DatagramPacket(message, message.length, _group, DNSConstants.MDNS_PORT);

        if (logger.isLoggable(Level.FINEST))
        {
            try
            {
                final DNSIncoming msg = new DNSIncoming(packet);
                if (logger.isLoggable(Level.FINEST))
                {
                    logger.finest("send(" + this.getName() + ") JmDNS out:" + msg.print(true));
                }
            }
            catch (final IOException e)
            {
                logger.throwing(getClass().toString(), "send(" + this.getName() + ") - JmDNS can not parse what it sends!!!", e);
            }
        }
        final MulticastSocket ms = _socket;
        if (ms != null && !ms.isClosed())
        {
            ms.send(packet);
        }
    }
}
 
开发者ID:blackshadowwalker,项目名称:log4j-collector,代码行数:35,代码来源:JmDNSImpl.java

示例3: Responder

public Responder(JmDNSImpl jmDNSImpl, DNSIncoming in, int port) {
    super(jmDNSImpl);
    this._in = in;
    this._unicast = (port != DNSConstants.MDNS_PORT);
}
 
开发者ID:iilxy,项目名称:AndroidmDNS,代码行数:5,代码来源:Responder.java

示例4: Responder

public Responder(JmDNSImpl jmDNSImpl, DNSIncoming in, int port)
{
    super(jmDNSImpl);
    this._in = in;
    this._unicast = (port != DNSConstants.MDNS_PORT);
}
 
开发者ID:blackshadowwalker,项目名称:log4j-collector,代码行数:6,代码来源:Responder.java


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