title: Jetty Websocket, closing session OpCode 12
body: <p>I've been working on a chat client-server using Jetty websockets and Java.
  However I'm currently getting a strange error, while debugging my code (I won't post my code, as it is part of a larger and complex project, and i don't expect anybody to read all of it, except me)
  But i'd like to know if any of you met a similar error, or know how to understand it ?</p>
  
  <p>Whenever I try to connect with my client, as soon as the first HTTP request of the handshake reaches the server, and the upgrade is supposed to proceed, i get this error and the end of the handshake without any upgrade.</p>
  
  <p>Error message taken from the client side:</p>
  
  <pre><code> Session Opened:WebSocketSession[websocket=JettyAnnotatedEventDriver[amos.client.unpublic.test.yoko.websocket.AnnotatedSocket@4e33a461],behavior=CLIENT,connection=WebSocketClientConnection@68161ae2{FILLING}{f=Flusher[queueSize=0,aggregateSize=0,failure=null],g=Generator[CLIENT,validating],p=Parser@1c415223[ExtensionStack,s=START,c=0,len=0,f=null,p=WebSocketPolicy@44588a43[behavior=CLIENT,maxTextMessageSize=10000000,maxTextMessageBufferSize=10000000,maxBinaryMessageSize=10000000,maxBinaryMessageBufferSize=10000000,asyncWriteTimeout=60000,idleTimeout=300000,inputBufferSize=4096]]},remote=WebSocketRemoteEndpoint@3f32a8b7[batching=true],incoming=JettyAnnotatedEventDriver[amos.client.unpublic.test.yoko.websocket.AnnotatedSocket@4e33a461],outgoing=ExtensionStack[queueSize=0,extensions=[],incoming=org.eclipse.jetty.websocket.common.WebSocketSession,outgoing=org.eclipse.jetty.websocket.client.io.WebSocketClientConnection]]
   2017-05-08T16:53:08.668    DEBUG   WebSocketClient@12654428-52 Parsing extra remaining buffer from UpgradeConnection
   2017-05-08T16:53:08.668    DEBUG   WebSocketClient@12654428-46-selector-WebSocketClientSelectorManager@5e31283d/0  Key interests updated 1 -&gt; 0
   2017-05-08T16:53:08.668    DEBUG   WebSocketClient@12654428-46-selector-WebSocketClientSelectorManager@5e31283d/0  Local interests updated 1 -&gt; 0 for SelectChannelEndPoint@6fbfc570{localhost/127.0.0.1:5080&lt;-&gt;55844,Open,in,out,-,-,300000,WebSocketClientConnection}{io=0,kio=0,kro=1}
   2017-05-08T16:53:08.668    DEBUG   WebSocketClient@12654428-46-selector-WebSocketClientSelectorManager@5e31283d/0  Running change org.eclipse.jetty.io.SelectChannelEndPoint$1@2810e813
   2017-05-08T16:53:08.668    DEBUG   WebSocketClient@12654428-46-selector-WebSocketClientSelectorManager@5e31283d/0  FILL_INTERESTED--&gt;FILLING WebSocketClientConnection@68161ae2{FILLING}{f=Flusher[queueSize=0,aggregateSize=0,failure=null],g=Generator[CLIENT,validating],p=Parser@1c415223[ExtensionStack,s=START,c=0,len=0,f=null,p=WebSocketPolicy@44588a43[behavior=CLIENT,maxTextMessageSize=10000000,maxTextMessageBufferSize=10000000,maxBinaryMessageSize=10000000,maxBinaryMessageBufferSize=10000000,asyncWriteTimeout=60000,idleTimeout=300000,inputBufferSize=4096]]}
   2017-05-08T16:53:08.668    DEBUG   WebSocketClient@12654428-52 terminateConnection(1,002,Unknown opcode: 12)
  </code></pre>
  
  <p>I've looked up the OpCode from the RFC 6455 :</p>
  
  <pre><code>|Opcode  | Meaning                               | Reference |
  -+--------+-------------------------------------+-----------|
   | 0      | Continuation Frame                  | RFC 6455  |
  -+--------+-------------------------------------+-----------|
   | 1      | Text Frame                          | RFC 6455  |
  -+--------+-------------------------------------+-----------|
   | 2      | Binary Frame                        | RFC 6455  |
  -+--------+-------------------------------------+-----------|
   | 8      | Connection Close Frame              | RFC 6455  |
  -+--------+-------------------------------------+-----------|
   | 9      | Ping Frame                          | RFC 6455  |
  -+--------+-------------------------------------+-----------|
   | 10     | Pong Frame                          | RFC 6455  |
  -+--------+-------------------------------------+-----------|
  </code></pre>
  
  <p>But i don't get the meaning of the OpCode :12 in my debugging.</p>
  
  <p>I suppose it is related to the fact that there are some data remaining in the buffer and the code isn't received/parsed properly, is it just an unproperly fragmented ping/pong frame ? Can it come from the fact that i have numerous servlet and this causes a conflict in the session treatment ?</p>
  
  <p>EDIT: I am using jetty websocket API on both sides (server &amp; client), i am using the 9.1.5 version.</p>
  
  <p>I'd appreciate any hint or help !
  Thanks a lot,
  A curious programmer apprentice.</p>