This is a Java library that implements Websockt API (Draft-75/76) for Android platform. Library uses java.nio.* packages for efficient non-blocking evented behavior. It easily gets integrated with Phonegap framework.
For the Draft76 handshake request, when it was calling Write() a second time specifically for the key3 bytes, it causes those last 8 bytes to be sent across the wire in a second packet, separate from the initial GET handshake request. This was causing very frequent yet sporadic non-connects for me (server would reply with 501 because the it didn't get the third key in time).
I just added a small chunk of code that ensures all three of the websocket keys get sent in that first inital packet.
Chrome/Safari both send everything in the first packet, looks like that is what the spec intended as well.
For the Draft76 handshake request, when it was calling Write() a second time specifically for the key3 bytes, it causes those last 8 bytes to be sent across the wire in a second packet, separate from the initial GET handshake request. This was causing very frequent yet sporadic non-connects for me (server would reply with 501 because the it didn't get the third key in time).
I just added a small chunk of code that ensures all three of the websocket keys get sent in that first inital packet.
Chrome/Safari both send everything in the first packet, looks like that is what the spec intended as well.
PS. THIS PROJECT WAS A LIFE SAVER!!!