Am 27.05.2012 08:57, schrieb robkoch86:
> Hello,
>
> I'm working on a Java-based WebSockets-proxy and started to use the
> Autobahn test suite to ensure that all frames are processed correctly
> and not modified. I love Autobahn as it is so comprehensive - great work!
Thanks! Good to get positive feedback ..
>
> Unfortunately I got stuck with some test cases. Specifically I have
> problems with 1.1.8. Basically I fail to pass test cases where the chop
> size (= payload size of one TCP packet) is checked. How can I ensure the
> retransmission with the same chop size?
The "chopped tests" test whether an implementation is agnostic to how
the TCP stream is split up into TCP segments and IP packets ..
>
> * How can I retrieve the chop size in Java (when working with
> Sockets)? I mean, I'm operating on an input stream that is not
> packet-aware.
> * How can I set the chop size (i.e.: finish the TCP packet)? Once I
> retrieved the chop size, does flush() suffice to start a new TCP packet?
>
> I searched the web, but was not able to find something appropriate. I
> hope that there is someone out, that used Autobahn with Java or is
> experienced with networking in Java and can guide me into the right
> direction.
The packetizing of a TCP stream into TCP segments and IP packets is done
and under the control of the TCP stack within the OS kernel. There is no
(easy) way of fully/exactly controlling this process, only heuristics.
Like pushing 1 byte to the stream, then syncing/flushing, and waiting
for some time, so that the chance of having that 1 byte sent out in a
separate segment / IP packet is quite high.
>
> If it won't be possible, is it really necessary for a WebSockets
> implementation (with regards to the standard - RFC6455) to adhere to
> this chop-size?
An implementation failing 1.1.8 isn't "TCP-clean", and this is a severe
problem of the implementation that really needs to be fixed. You won't
find any mentioning of "TCP-clean" in RFC6455, since it's just assumed
that a WS impl. is able to cope with any possible packetizing of a TCP
stream.
Hope this helps,
Tobias
>
> Best wishes
> Robert