Bug in GlassFish 4 or Tyrus: Decoder#willDecode is called twice for each ByteBuffer?

…衆ロ難τιáo~ 提交于 2020-01-15 12:25:09

问题


I wrote the most simple application that uses WebSockets. My back end is GlassFish 4 build 89, my front end is a JavaFX 2.2 application client that uses Tyrus 1.0 RC3, the reference implementation of Java API for WebSockets. GlassFish uses Tyrus too although I've been to lazy to lookup exactly what version is included in GlassFish build 89.

My test of the WebSocket API sent a java.util.Date back and forth, nothing more. Well, as a binary object should be added. So I wrote my own Decoder that implements Decoder.Binary<Date>. As usual when I enter new fields of knowledge, I like to log each method invocation. And when I looked in the console, it hit me that my Deocer.Binary<Date>#willDecode(ByteBuffer) method was called twice in a row by the same thread! If that really is intentional, what would be the use case for such a pattern, what value was added? But I think it must be a bug! I tried to file a bug/issue over at some GlassFish JIRA site but I didn't find the button anywhere.


回答1:


not a bug in terms of specification violation (there is no restriction on "willDecode" invocation count), but I agree we should look into it.

progress can be tracked on Tyrus jira, see TYRUS-210.

Thanks!



来源:https://stackoverflow.com/questions/17131946/bug-in-glassfish-4-or-tyrus-decoderwilldecode-is-called-twice-for-each-bytebuf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!