If a string in the JSON content contains any characters longer than one byte (ie non-ASCII), the byte array written to the stream in LongPollingTransport.GetRequestStreamCallback misses bytes due to the wrong length being passed to postStream.Write(). This results in a HTTP 400 Bad Request from the server due to malformed JSON.
If a string in the JSON content contains any characters longer than one byte (ie non-ASCII), the byte array written to the stream in LongPollingTransport.GetRequestStreamCallback misses bytes due to the wrong length being passed to postStream.Write(). This results in a HTTP 400 Bad Request from the server due to malformed JSON.
I hadn't seen any activity on the project lately so I've forked CometD.NET and committed my fix - https://github.com/lukecarroll/CometD.NET/commit/2f170564fbbbe84d9baedf48a87377afb283866c
Cheers