Open neevlek opened 11 years ago
Are you sure you're not using an old web browser? Older versions are using previous web socket spec drafts, not the final specification. "Browser support" section under http://en.wikipedia.org/wiki/WebSocket has more details. CoreWebSocket is using the most recent (only one that's standardised) protocol version 13 RFC 6455.
You can test it by getting most up to date Chrome on SL. If the problem persists, I can try to install it on my VM to see what's happening there, please let know.
Yes, the problem persists even on the latest version of Chrome and Firefox (both supporting RFC6455), except for Safari which is only up to 5.1.10 for SL (thus supporting on hybi 00)
I have added the following lines just before sending the rfc6455 write handshake (WebSocketClientWriteWithHTTPMessage) and it seems to work for both Chrome and Firefox after that:
//hack to fix issue on 10.6.8
CFDataRef data = CFDataCreateMutable(client->allocator, 0);
CFHTTPMessageSetBody(response, data);
success = __WebSocketClientWriteWithHTTPMessage(client, response);
Can you create pull request for it?
I have been running the CoreWebSocketConsole example with the test.html client without any issues in receiving or sending messages on my development machine (Mac OS X 10.9).
However, recently when I tested it on another machine based on Mac OS X 10.6.8 (Snow Leopard), only incoming messages were received, but none of the outgoing messages were sent successfully to the test client.
A 'kCFStreamEventErrorOccurred' event is received by __WebSocketClientWriteCallBack followed by a console message that says: ' kCFStreamEventErrorOccurred (write) ' ' Error Domain=NSPOSIXErrorDomain Code=32 UserInfo=0x501300 "The operation couldn't be completed. Broken pipe" '