2012-08-06, 18:39
I enabled Debug logging, and found the following in the xmb.log file.
Edit/Update:
I continued my research and made a small .NET program wich does not use the WebSocket class but the TcpClient class. I copied the working HTTP request to the testapplication and let it send. I succesfully received a 'Switching protocols' response. Then I changed the HTTP request a bit, "Upgrade: websocket" became "Upgrade: Websocket" (capital W). Suddenly it does not work Tried the same with the original request from .NET, modiefied it to not use a capital and then it works fine. Looks a capital issue to me.
Protocol says it should be case-insensitive, see Page 18 subject 2.
http://tools.ietf.org/html/rfc6455#page-18
Edit/Update 2:
I made a bug report for this issue in TRAC: http://trac.xbmc.org/ticket/13231
Quote:18:36:36 T:1284478048 DEBUG: JSONRPC Server: New connection detectedLooks like XBMC and .NET do implement RFC6455 in a different way. Maybe it is because in the working connection the upgrade is "websocket" and in the non-working it is "Websocket", capital use issue?
18:36:36 T:1284478048 INFO: JSONRPC Server: New connection added
18:36:36 T:1284478048 INFO: WebSocket [RFC6455]: invalid "Upgrade" received
18:36:36 T:1284478048 INFO: WebSocket: No frame expected in the current state
18:37:06 T:1284478048 INFO: JSONRPC Server: Disconnection detected
Edit/Update:
I continued my research and made a small .NET program wich does not use the WebSocket class but the TcpClient class. I copied the working HTTP request to the testapplication and let it send. I succesfully received a 'Switching protocols' response. Then I changed the HTTP request a bit, "Upgrade: websocket" became "Upgrade: Websocket" (capital W). Suddenly it does not work Tried the same with the original request from .NET, modiefied it to not use a capital and then it works fine. Looks a capital issue to me.
Protocol says it should be case-insensitive, see Page 18 subject 2.
http://tools.ietf.org/html/rfc6455#page-18
Edit/Update 2:
I made a bug report for this issue in TRAC: http://trac.xbmc.org/ticket/13231