저는 Jetty 9 EndPoint를 처음으로 사용하고 있습니다.
하지만 사용 방법에 관해서는 붙어 있습니다. EndPoint.flush (ByteBuffer) 메서드 returncode.
호출이 성공할 때까지 무기한으로 반복해야합니까? 진정한 IFF 모든 버퍼가 소비되었으며, 엔드 포인트 (즉, 데이터를 버퍼링하지 않음) 대상에 데이터를 플러시했습니다Jetty EndPoint.flush (ByteBuffer b)가 false를 반환하면 어떻게해야합니까?
자바 독은
반환 말한다. 그런데
, 내가가 전화 했어 인스턴스 내가 SocketEndpoint은 권장하지 않습니다 이유에 어떤 문서를 찾을 수 및 SelectChannelEndpoint 수 없기 때문에 어떤 통찰력이, 감사 유형 SSL 접속 $ DecryptedEndPoint
입니다 바람직하다.
어쨌든 약간의 어쨌든; 놀랍게도 내가 에 NetworkTrafficSelectChannelEndPoint이 발견 :
작업을 | = 대신 & = (부두 - 모든 9.0.3.v20130506-sources.jar에 있음)
@Override
public boolean flush(ByteBuffer... buffers) throws IOException
{
boolean flushed=true;
for (ByteBuffer b : buffers)
{
if (b.hasRemaining())
{
int position = b.position();
flushed|=super.flush(b); // <<-- shouldn't it be &=
int l=b.position()-position;
notifyOutgoing(b, position, l);
if (!flushed)
break;
}
}
return flushed;
}
분명히 버그였습니다. 불완전한 쓰기가 잘못 계산되었습니다. 방금 수정했습니다. http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/commit/?id=f8049caf3d85089c52a8f72d4b3e22b8e456031d –