I 주석 처리 된 Thread.sleep()
코드로 돌려 놓을 때 웹 소켓톰캣 웹 소켓 클라이언트 프레임
protected void dequeue() throws InterruptedException, IOException
{
ByteBuffer bbuf;
System.out.println("start");
while((bbuf = messageQueue.take()).get(0) != 0)
{
bbuf.position(bbuf.limit());
if(bbuf.get(0)== 0)
System.out.println("here");
bbuf.flip();
for(Session session : sessionList)
{
//Thread.sleep(10000);
if(!session.isOpen())
break;
session.getBasicRemote().sendBinary(bbuf);
}
}
System.out.println("end");
}
코드의 clientendpoint
으로 자바에서 실행되는 다음 코드는 잘 작동합니다. Thread.sleep()
이 코드에 포함되지 않습니다 그러나 때 웹 소켓에 쓰기 때로는
CloseReason: code [1002], reason [The client frame set the reserved bits to [7] which was not supported by this endpoint]
첫 번째 메시지가 기록 된 다음과 같은 이유가 주어진 후 @onClose
이라고합니다 일을하고 다른 시간에 어느 [7]
을에서 때로는 1,2 등이 될 것입니다. 나는 이것이 실제로 일어날 수있는 일을 실제로 발견하지 못했고, 일어난 일에 대해 어떤 통찰력을 가지고있는 사람이 있습니까? 참고로, 나는 tomcat 7.0.53
을 사용하여 websocket의 ServerSide를 호스팅하고 HTTP 대신 HTTPS를 사용합니다.