TscHubConnection.Send results in InvalidDataException

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
oscar
Posts: 9
Joined: Tue 17 Feb 2009 09:14

TscHubConnection.Send results in InvalidDataException

Post by oscar » Thu 12 Mar 2020 13:26

Hi All,

Each function of our signalR server i've tried to call with the TcsHubConnection.Send, results in an exception: InvalidDataException: Unexpected end when reading JSON,
even functions that returns nothing (void).

Our signalR server is build using asp.net core 3.1, is the protocol used not compatible with TscHubConnection?
Any help would be appreciated.

Tia, Rj

ViktorV
Devart Team
Posts: 2908
Joined: Wed 30 Jul 2014 07:16

Re: TscHubConnection.Send results in InvalidDataException

Post by ViktorV » Fri 13 Mar 2020 10:01

Unfortunately, we haven't been able to reproduce the issue.
In order for us to be able to give you a detailed answer, we need a sample demonstrating the behavior you mentioned. Therefore, please, compose a small sample demonstrating the described behavior and send it to us using the contact form https://devart.com/company/contactform.html

rballz79
Posts: 3
Joined: Wed 25 Mar 2020 20:00

Re: TscHubConnection.Send results in InvalidDataException

Post by rballz79 » Wed 25 Mar 2020 20:13

I get the same thing.

Fresh asp.net core web app, 3.1 -> added latest signalr. Simple ChatHub class with the following method:


Code: Select all

       
        public async Task SendMessage(string user, string message)
        {
            await Clients.All.SendAsync("ReceiveMessage", user, message);
        }
        
The following line of code causes the InvalidDataException->unexpected end reading json

Code: Select all

SignalRConnection.Register('SendMessage', DoMessageReceipt, [varString, varString]);
Comment the register line out and Start() gives no error - of course it also can't do anything with nothing registered...

rballz79
Posts: 3
Joined: Wed 25 Mar 2020 20:00

Re: TscHubConnection.Send results in InvalidDataException

Post by rballz79 » Wed 25 Mar 2020 20:45

Turned logging on Debug for SignalR.

Code: Select all

--> System.Text.Json.JsonReaderException:  The JSON object contains a trailing comma at the end which is not supported in this mode.  Change the reader options.  Linenumber: 0 | BytePositionInLine: 95.

ViktorV
Devart Team
Posts: 2908
Joined: Wed 30 Jul 2014 07:16

Re: TscHubConnection.Send results in InvalidDataException

Post by ViktorV » Thu 26 Mar 2020 09:46

Please provide your license number and IDE version to us and we will send you a night build which may resolve the issue.

rballz79
Posts: 3
Joined: Wed 25 Mar 2020 20:00

Re: TscHubConnection.Send results in InvalidDataException

Post by rballz79 » Thu 26 Mar 2020 18:35

Sent via email, thank you

ViktorV
Devart Team
Posts: 2908
Joined: Wed 30 Jul 2014 07:16

Re: TscHubConnection.Send results in InvalidDataException

Post by ViktorV » Fri 27 Mar 2020 10:25

We have answered you via e-mail.

Post Reply