Subject: [hybi] Close Frame in the middle of a message

From: Zhong Yu <[email-masked]>
Date: Fri, 30 Aug 2013 13:24:16 -0500

If a Close Frame arrives before the current message is terminated, how
should the server react? Is it required that the server responds with
a Close Frame? Can the server consider this a serious error and drop
the connection without a Close Frame?

Thanks,
Zhong Yu

---

From: Joakim Erdfelt <[email-masked]>
Date: Fri, 30 Aug 2013 12:28:33 -0700

A close frame between the individual frames making up a single message is
allowed.

It is not an error to receive such a frame, so normal close operations
should commence.
It is, however, an error if the endpoint that sent the close frame sends
more data frames after the close frame.

Section 5.5.1 outlines this rule.
http://tools.ietf.org/html/rfc6455#section-5.5.1

   The application MUST NOT send any more data frames after sending a
   Close frame.

This is because sending a close frame essentially says you are no longer
going send any other frames.
But until you receive the close frame response, you can continue to read
frames (just can't respond)

--
Joakim Erdfelt <[email-masked]>
webtide.com <http://www.webtide.com/> - intalio.com/jetty
Expert advice, services and support from from the Jetty & CometD experts
eclipse.org/jetty - cometd.org

On Fri, Aug 30, 2013 at 11:24 AM, Zhong Yu <[email-masked]> wrote:

> _______________________________________________
> hybi mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/hybi
>

---

From: Zhong Yu <[email-masked]>
Date: Fri, 30 Aug 2013 15:37:14 -0500

It is certainly not a framing error. However the message is corrupt,
something must be terribly wrong on the sending end. I believe the
application on the receiving end should see an error, and it may elect
to close the connection uncleanly, because the sending end appears to
be defunct.

Zhong Yu

On Fri, Aug 30, 2013 at 2:28 PM, Joakim Erdfelt <[email-masked]> wrote:
> webtide.com - intalio.com/jetty