{"action":"created","issue":{"url":"https://api.github.com/repos/ReactiveSocket/reactivesocket/issues/46","labels_url":"https://api.github.com/repos/ReactiveSocket/reactivesocket/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/ReactiveSocket/reactivesocket/issues/46/comments","events_url":"https://api.github.com/repos/ReactiveSocket/reactivesocket/issues/46/events","html_url":"https://github.com/ReactiveSocket/reactivesocket/issues/46","id":103607462,"number":46,"title":"Flags appearing before frame type requires reverse parsing","user":{"login":"wmiaw","id":156189,"avatar_url":"https://avatars.githubusercontent.com/u/156189?v=3","gravatar_id":"","url":"https://api.github.com/users/wmiaw","html_url":"https://github.com/wmiaw","followers_url":"https://api.github.com/users/wmiaw/followers","following_url":"https://api.github.com/users/wmiaw/following{/other_user}","gists_url":"https://api.github.com/users/wmiaw/gists{/gist_id}","starred_url":"https://api.github.com/users/wmiaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wmiaw/subscriptions","organizations_url":"https://api.github.com/users/wmiaw/orgs","repos_url":"https://api.github.com/users/wmiaw/repos","events_url":"https://api.github.com/users/wmiaw/events{/privacy}","received_events_url":"https://api.github.com/users/wmiaw/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-27T22:22:40Z","updated_at":"2015-08-29T07:31:11Z","closed_at":null,"body":"Currently flags appear in the 8 bits between VERSION and FRAME TYPE in the frame header. I thought at first this means flags should be identified by the version. This is further supported by the idea there is an I flag to ignore the frame (type) if not understood, but the M flag is per-frame type, and the remaining 6 bits are flags available for a frame type to define.\r\n\r\nWhy are you placing flags before the frame type? Are you trying to align things on 16-bit boundaries? If so, why? I don't think you need to unless you are trying to match this to some underlying protocol or link layer.\r\n\r\n(The I flag appears to be pointless—if the receiver can't understand a frame then of course it has to ignore it.)"},"comment":{"url":"https://api.github.com/repos/ReactiveSocket/reactivesocket/issues/comments/135952605","html_url":"https://github.com/ReactiveSocket/reactivesocket/issues/46#issuecomment-135952605","issue_url":"https://api.github.com/repos/ReactiveSocket/reactivesocket/issues/46","id":135952605,"user":{"login":"NiteshKant","id":820005,"avatar_url":"https://avatars.githubusercontent.com/u/820005?v=3","gravatar_id":"","url":"https://api.github.com/users/NiteshKant","html_url":"https://github.com/NiteshKant","followers_url":"https://api.github.com/users/NiteshKant/followers","following_url":"https://api.github.com/users/NiteshKant/following{/other_user}","gists_url":"https://api.github.com/users/NiteshKant/gists{/gist_id}","starred_url":"https://api.github.com/users/NiteshKant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NiteshKant/subscriptions","organizations_url":"https://api.github.com/users/NiteshKant/orgs","repos_url":"https://api.github.com/users/NiteshKant/repos","events_url":"https://api.github.com/users/NiteshKant/events{/privacy}","received_events_url":"https://api.github.com/users/NiteshKant/received_events","type":"User","site_admin":false},"created_at":"2015-08-29T07:31:11Z","updated_at":"2015-08-29T07:31:11Z","body":">>> If it really is that the flag bits can differ by frame type, then they should appear after the frame type otherwise a streaming parser has to \"parse backwards\".\r\n\r\nA streaming parser that parses a bit at a time would, may be. Parsers usually would parse the \"data\" in a streaming fashion and not really frame headers which are strictly bit aligned, as here. For the systems we are talking about, It would be ok to buffer 8 bytes for example to understand the frame layout completely. So, I do not see any problem here.\r\n\r\n>>> The I flag is currently defined as \"ignore frame if not understood\", not \"terminate the connection if not understood\".\r\n\r\nWhat it means is that if the bit is set then ignore, if not then don't ignore, which would mean take an action as you deem necessary; ignore request, send error, close connection, whatever the application desires. I am not sure we should be prescriptive here of what \"don't ignore\" means. OTOH, having the ignore flag is handy to tag really ignorable flags otherwise it is non-deterministic as to what a receiver should do with a frame it does not understand without breaking the requesters expectations."}}