문제

In the specification Java API for WebSocket 1.0, also known as JSR-356, it says on page 16:

On Decoder implementations that have it, the implementation must use the willDecode() method on the decoder to determine if the Decoder will match the incoming message.

.. and on page 17:

If the Decoder implementation has the method, the implementation must use the willDecode() method on the decoder to determine if the Decoder will match the incoming message

Clearly then, it is optional for me as a developer to provide that method or not. However, if you look at the Java EE 7 API, the interface Decoder.Binary and Decoder.Text declares this method. Thus when I write a decoder class that implements one of these interfaces, then I must also provide an implementation for willDecode(). The way I see it, there's no free choice any more. Am I wrong?

도움이 되었습니까?

해결책

Yes. These are optional. Encode and Decode use for security purpose in data transmission.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top