gpt4 book ai didi

org.apache.catalina.tribes.io.XByteBuffer.doesPackageExist()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 16:59:40 24 4
gpt4 key购买 nike

本文整理了Java中org.apache.catalina.tribes.io.XByteBuffer.doesPackageExist()方法的一些代码示例,展示了XByteBuffer.doesPackageExist()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XByteBuffer.doesPackageExist()方法的具体详情如下:
包路径:org.apache.catalina.tribes.io.XByteBuffer
类名称:XByteBuffer
方法名:doesPackageExist

XByteBuffer.doesPackageExist介绍

[英]Method to check if a package exists in this byte buffer.
[中]方法检查此字节缓冲区中是否存在包。

代码示例

代码示例来源:origin: org.apache.catalina.springsource/com.springsource.org.apache.catalina.tribes.springsource

protected boolean read(SelectionKey key) throws IOException {
  //if there is no message here, we are done
  if ( current == null ) return true;
  int read = socketChannel.read(readbuf);
  //end of stream
  if ( read == -1 ) throw new IOException("Unable to receive an ack message. EOF on socket channel has been reached.");
  //no data read
  else if ( read == 0 ) return false;
  readbuf.flip();
  ackbuf.append(readbuf,read);
  readbuf.clear();
  if (ackbuf.doesPackageExist() ) {
    byte[] ackcmd = ackbuf.extractDataPackage(true).getBytes();
    boolean ack = Arrays.equals(ackcmd,org.apache.catalina.tribes.transport.Constants.ACK_DATA);
    boolean fack = Arrays.equals(ackcmd,org.apache.catalina.tribes.transport.Constants.FAIL_ACK_DATA);
    if ( fack && getThrowOnFailedAck() ) throw new RemoteProcessException("Received a failed ack:org.apache.catalina.tribes.transport.Constants.FAIL_ACK_DATA");
    return ack || fack;
  } else {
    return false;
  }
}

代码示例来源:origin: codefollower/Tomcat-Research

protected boolean read() throws IOException {
  //if there is no message here, we are done
  if ( current == null ) return true;
  int read = isUdpBased()?dataChannel.read(readbuf) : socketChannel.read(readbuf);
  //end of stream
  if ( read == -1 ) throw new IOException("Unable to receive an ack message. EOF on socket channel has been reached.");
  //no data read
  else if ( read == 0 ) return false;
  readbuf.flip();
  ackbuf.append(readbuf,read);
  readbuf.clear();
  if (ackbuf.doesPackageExist() ) {
    byte[] ackcmd = ackbuf.extractDataPackage(true).getBytes();
    boolean ack = Arrays.equals(ackcmd,org.apache.catalina.tribes.transport.Constants.ACK_DATA);
    boolean fack = Arrays.equals(ackcmd,org.apache.catalina.tribes.transport.Constants.FAIL_ACK_DATA);
    if ( fack && getThrowOnFailedAck() ) throw new RemoteProcessException("Received a failed ack:org.apache.catalina.tribes.transport.Constants.FAIL_ACK_DATA");
    return ack || fack;
  } else {
    return false;
  }
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/tribes

protected boolean read(SelectionKey key) throws IOException {
  //if there is no message here, we are done
  if ( current == null ) return true;
  int read = isUdpBased()?dataChannel.read(readbuf) : socketChannel.read(readbuf);
  //end of stream
  if ( read == -1 ) throw new IOException("Unable to receive an ack message. EOF on socket channel has been reached.");
  //no data read
  else if ( read == 0 ) return false;
  readbuf.flip();
  ackbuf.append(readbuf,read);
  readbuf.clear();
  if (ackbuf.doesPackageExist() ) {
    byte[] ackcmd = ackbuf.extractDataPackage(true).getBytes();
    boolean ack = Arrays.equals(ackcmd,org.apache.catalina.tribes.transport.Constants.ACK_DATA);
    boolean fack = Arrays.equals(ackcmd,org.apache.catalina.tribes.transport.Constants.FAIL_ACK_DATA);
    if ( fack && getThrowOnFailedAck() ) throw new RemoteProcessException("Received a failed ack:org.apache.catalina.tribes.transport.Constants.FAIL_ACK_DATA");
    return ack || fack;
  } else {
    return false;
  }
}

代码示例来源:origin: org.apache.tomcat/tomcat-tribes

protected boolean read() throws IOException {
  //if there is no message here, we are done
  if ( current == null ) return true;
  int read = isUdpBased()?dataChannel.read(readbuf) : socketChannel.read(readbuf);
  //end of stream
  if ( read == -1 ) throw new IOException(sm.getString("nioSender.unable.receive.ack"));
  //no data read
  else if ( read == 0 ) return false;
  readbuf.flip();
  ackbuf.append(readbuf,read);
  readbuf.clear();
  if (ackbuf.doesPackageExist() ) {
    byte[] ackcmd = ackbuf.extractDataPackage(true).getBytes();
    boolean ack = Arrays.equals(ackcmd,org.apache.catalina.tribes.transport.Constants.ACK_DATA);
    boolean fack = Arrays.equals(ackcmd,org.apache.catalina.tribes.transport.Constants.FAIL_ACK_DATA);
    if ( fack && getThrowOnFailedAck() ) throw new RemoteProcessException(sm.getString("nioSender.receive.failedAck"));
    return ack || fack;
  } else {
    return false;
  }
}

代码示例来源:origin: codefollower/Tomcat-Research

byte d = (byte)i;
ackbuf.append(d);
if (ackbuf.doesPackageExist() ) {
  byte[] ackcmd = ackbuf.extractDataPackage(true).getBytes();
  ackReceived = Arrays.equals(ackcmd,org.apache.catalina.tribes.transport.Constants.ACK_DATA);

代码示例来源:origin: org.apache.geronimo.ext.tomcat/tribes

byte d = (byte)i;
ackbuf.append(d);
if (ackbuf.doesPackageExist() ) {
  byte[] ackcmd = ackbuf.extractDataPackage(true).getBytes();
  ackReceived = Arrays.equals(ackcmd,org.apache.catalina.tribes.transport.Constants.ACK_DATA);

代码示例来源:origin: org.apache.catalina.springsource/com.springsource.org.apache.catalina.tribes.springsource

byte d = (byte)i;
ackbuf.append(d);
if (ackbuf.doesPackageExist() ) {
  byte[] ackcmd = ackbuf.extractDataPackage(true).getBytes();
  ackReceived = Arrays.equals(ackcmd,org.apache.catalina.tribes.transport.Constants.ACK_DATA);

代码示例来源:origin: org.apache.tomcat/tomcat-tribes

byte d = (byte)i;
ackbuf.append(d);
if (ackbuf.doesPackageExist() ) {
  byte[] ackcmd = ackbuf.extractDataPackage(true).getBytes();
  ackReceived = Arrays.equals(ackcmd,org.apache.catalina.tribes.transport.Constants.ACK_DATA);

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com