本文整理汇总了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);
}
}
}
示例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);
}
}
}
示例3: Responder
public Responder(JmDNSImpl jmDNSImpl, DNSIncoming in, int port) {
super(jmDNSImpl);
this._in = in;
this._unicast = (port != DNSConstants.MDNS_PORT);
}
示例4: Responder
public Responder(JmDNSImpl jmDNSImpl, DNSIncoming in, int port)
{
super(jmDNSImpl);
this._in = in;
this._unicast = (port != DNSConstants.MDNS_PORT);
}