本文整理汇总了Java中javax.jmdns.impl.constants.DNSConstants.FLAGS_AA属性的典型用法代码示例。如果您正苦于以下问题:Java DNSConstants.FLAGS_AA属性的具体用法?Java DNSConstants.FLAGS_AA怎么用?Java DNSConstants.FLAGS_AA使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javax.jmdns.impl.constants.DNSConstants
的用法示例。
在下文中一共展示了DNSConstants.FLAGS_AA属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addAnswer
/**
* Add an answer to a question. Deal with the case when the outgoing packet overflows
*
* @param in
* @param addr
* @param port
* @param out
* @param rec
* @return outgoing answer
* @exception IOException
*/
public DNSOutgoing addAnswer(DNSIncoming in, InetAddress addr, int port, DNSOutgoing out, DNSRecord rec) throws IOException {
DNSOutgoing newOut = out;
if (newOut == null) {
newOut = new DNSOutgoing(DNSConstants.FLAGS_QR_RESPONSE | DNSConstants.FLAGS_AA, false, in.getSenderUDPPayload());
}
try {
newOut.addAnswer(in, rec);
} catch (final IOException e) {
newOut.setFlags(newOut.getFlags() | DNSConstants.FLAGS_TC);
newOut.setId(in.getId());
send(newOut);
newOut = new DNSOutgoing(DNSConstants.FLAGS_QR_RESPONSE | DNSConstants.FLAGS_AA, false, in.getSenderUDPPayload());
newOut.addAnswer(in, rec);
}
return newOut;
}
示例2: addAnswer
/**
* Add an answer to a question. Deal with the case when the outgoing packet overflows
*
* @param in
* @param addr
* @param port
* @param out
* @param rec
* @return outgoing answer
* @throws java.io.IOException
*/
public DNSOutgoing addAnswer(DNSIncoming in, InetAddress addr, int port, DNSOutgoing out, DNSRecord rec) throws IOException
{
DNSOutgoing newOut = out;
if (newOut == null)
{
newOut = new DNSOutgoing(DNSConstants.FLAGS_QR_RESPONSE | DNSConstants.FLAGS_AA, false, in.getSenderUDPPayload());
}
try
{
newOut.addAnswer(in, rec);
}
catch (final IOException e)
{
newOut.setFlags(newOut.getFlags() | DNSConstants.FLAGS_TC);
newOut.setId(in.getId());
send(newOut);
newOut = new DNSOutgoing(DNSConstants.FLAGS_QR_RESPONSE | DNSConstants.FLAGS_AA, false, in.getSenderUDPPayload());
newOut.addAnswer(in, rec);
}
return newOut;
}
示例3: createOugoing
@Override
protected DNSOutgoing createOugoing() {
return new DNSOutgoing(DNSConstants.FLAGS_QR_RESPONSE | DNSConstants.FLAGS_AA);
}
示例4: createOugoing
@Override
protected DNSOutgoing createOugoing()
{
return new DNSOutgoing(DNSConstants.FLAGS_QR_RESPONSE | DNSConstants.FLAGS_AA);
}
示例5: isAuthoritativeAnswer
/**
* Check if the message is an authoritative answer.
*
* @return true if the message is an authoritative answer
*/
public boolean isAuthoritativeAnswer() {
return (_flags & DNSConstants.FLAGS_AA) != 0;
}