Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9130391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:57:27+00:00 2026-06-17T07:57:27+00:00

I have the following JS code var chat = $.connection.MyHub; chat.client.initChart = function (data)

  • 0

I have the following JS code

var chat = $.connection.MyHub;
chat.client.initChart = function (data) { 
    ... do stuff ...
}

and this hub code

public class MyHub : Hub
{
    public override Task OnConnected()
    {
        using (var conn = new SqlConnection(ConnectionString))
        {
            conn.Open();

            //Using Dapper
            var data = conn.Query("SELECT data FROM Sql").ToList();


            return Clients.Caller.initChart(data);
        }
    }

}

this works perfectly on my machine (Win7Pro, IIS 7), however, when I deploy it to our server (Win2008R2, iis7) it doesn’t call the initChart function. I’ve got VS installed on the server, and when I debug the process, the OnConnected event is called and completes successfully, but nothing happens on the client. There are no JS errors or server side errors occurring that I can see.

Just to confuse things further, I have another function declared on the client that is called by an NServiceBus handler, this function gets called every time, I put a browser breakpoint in there & I can see it being called.

Checking the signalR logs on my machine it uses SSE, but on the server it falls back to long polling.

UPDATE: Just realized the server is sitting behind Akamai’s DSD, if I don’t go through this, it works, but I can’t see why it makes a difference.

2nd Update:

Here are the different response headers for the connect?transport=serverSentEvents&connectionId=9fce5552-4c2e-4739-93ea-501dda0a0654&connectionData=%5B%7B%22name%22%3A%22navigationtiminghub%22%7D%5D&tid=9 HTTP/1.1 call

first, the request when I call directly to origin:

HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Transfer-Encoding: chunked
Content-Type: text/event-stream
Expires: -1
Server: Microsoft-IIS/7.5
Date: Mon, 07 Jan 2013 01:08:26 GMT

and this is Akamai’s response. Note, according to wireshark, the response from our server to Akamai is identical to the above response

HTTP/1.1 200 OK
Content-Type: text/event-stream
Server: Microsoft-IIS/7.5
Expires: Mon, 07 Jan 2013 01:07:23 GMT
Cache-Control: max-age=0, no-cache, no-store
Pragma: no-cache
Date: Mon, 07 Jan 2013 01:07:23 GMT
Content-Length: 486
Connection: keep-alive

Also in the first one, the connection stays open (as it should) and in the second it closes.

UPDATE 3: This is purely an Akamai problem, we just switched to Edgecast & they respond to the SSE connect correctly.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:57:28+00:00Added an answer on June 17, 2026 at 7:57 am

    You can see this in the headers above, as you have a Content-Length header and you are also missing the Transfer-Encoding header in your response.

    You can’t enable buffering yourself but you can get their professional services team to do it for you.

    This seems to fix the Server Sent events for Chrome, but not the Forever Frame for IE9.

    With the Forever Frame this appears to be a compression issue. The Transfer-Encoding: chunked header is restored if you nuke the Accept-Encoding header from your request. Then IE works nicely. An exclusion for the edge’s gzip feature is required for the hub url.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: var entityConnection = (System.Data.EntityClient.EntityConnection)c.Connection; DbConnection conn = entityConnection.StoreConnection; ConnectionState
Inside my viewmodel I have following code: var self = this; self.Name = ko.observable(data.Name);
I have the following code var email = document.getElementById(email).value; $.post(/valid,{emailadd: email},function(data){ alert(data); }); on
I have the following code: var wait = 500; $(document).on(click,.new_game_list_row,function(event){ var self = $(this);
I have the following code: var submitHandler = function ($link, $form, close) { var
I have the following code: var refreshId = setInterval(function() { $(#footad).html('myjshere'); }, 15500); Where
I have the following code: var from = 0, step = 5; function showNext(list)
I have the following code: var string = word1;word2;word3,word4,word5,word6.word7; function ends_with(string, character) { var
I have the following JavaScript code - function addOnClickEventHandler() { var userNameElement = document.getElementById(currentUser);
I have the following code: var formSubmitHandler = function (link, form) { //e.preventDefault(); var

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.