long-polling

Long polling Stop other request for 1 or 2 minutes

余生长醉 提交于 2019-12-01 11:18:56
During create a chat system , I use a long life request to get message , and use a jquery request to send message like this : * Send: * $("#btn").click(function () { $.ajax({ type: "POST", url: "Chat.aspx/Insert", data: "{ 'Str' :'" + $("#txtStr").val() + "' }", contentType: "application/json; charset=utf-8", dataType: "json", success: function (data) { }, error: function () { } }); }); Receive : function Refresh() { $.ajax({ type: "POST", url: "Chat.aspx/GetRecords", data: "{ 'Id' : " + $("#hdnV1").val() + "}", success: function (data) { $.each($(data.d), function () { //Show it to user }); }

Long-polling in Laravel chat: Why is the div not updating itself?

天大地大妈咪最大 提交于 2019-12-01 10:39:33
I'm trying to build a laravel chat app with long-polling (I know there's nodejs/redis but there's a problem ) and therefore I have been trying to implement this example into Laravel and MySQL. However, the AJAX GET status request is always stuck at pending... . I figured this might be the cause that it is not updating the div where I display my new newly inputted value from an AJAX POST request on the same page. Currently, the div only updates itself on refresh. Here are my codes : View function getMsg(timestamp){ var queryString = {"timestamp":timestamp}; $.get( "create", queryString,

Long-polling (user notification) with a RESTful architecture

♀尐吖头ヾ 提交于 2019-12-01 10:36:34
问题 I'm working on a simple RESTful api (on NodeJs). I understand that being restful implies that horizontal scaling will be much easier. Unfortunately, I need some way for clients to be notified of certain events almost instantly. For this reason, I was thinking of doing long-polling. The question I have is how this work with multiple servers. For instance, here's a simplified used case: Both servers A and B are behind a common load balancer. User Alice posts a message on Bob's wall (PUT request

Long-polling in Laravel chat: Why is the div not updating itself?

僤鯓⒐⒋嵵緔 提交于 2019-12-01 08:40:33
问题 I'm trying to build a laravel chat app with long-polling (I know there's nodejs/redis but there's a problem) and therefore I have been trying to implement this example into Laravel and MySQL. However, the AJAX GET status request is always stuck at pending... . I figured this might be the cause that it is not updating the div where I display my new newly inputted value from an AJAX POST request on the same page. Currently, the div only updates itself on refresh. Here are my codes : View

Long polling server principle (client authentication)

妖精的绣舞 提交于 2019-12-01 08:25:50
Let's say that I have a long poll server which works as it should - when new client is connected to the website (he just connects as anonymous without authentication), new GUID is issued and stored in a signed cookie which identifies this connection during polls between client and server. Now the client wants to log in and continue as authenticated user. The problem is that long poll server (node.js) and web framework (ASP.NET) are working as standalone systems. I can use ASP.NET (MVC) specific authentication mechanism to log in from web framework point of view, but this doesn't affect long

Long polling Stop other request for 1 or 2 minutes

醉酒当歌 提交于 2019-12-01 07:28:15
问题 During create a chat system , I use a long life request to get message , and use a jquery request to send message like this : * Send: * $("#btn").click(function () { $.ajax({ type: "POST", url: "Chat.aspx/Insert", data: "{ 'Str' :'" + $("#txtStr").val() + "' }", contentType: "application/json; charset=utf-8", dataType: "json", success: function (data) { }, error: function () { } }); }); Receive : function Refresh() { $.ajax({ type: "POST", url: "Chat.aspx/GetRecords", data: "{ 'Id' : " + $("

Long polling server principle (client authentication)

为君一笑 提交于 2019-12-01 07:02:19
问题 Let's say that I have a long poll server which works as it should - when new client is connected to the website (he just connects as anonymous without authentication), new GUID is issued and stored in a signed cookie which identifies this connection during polls between client and server. Now the client wants to log in and continue as authenticated user. The problem is that long poll server (node.js) and web framework (ASP.NET) are working as standalone systems. I can use ASP.NET (MVC)

Long Polling with Ajax and PHP - Apache freezes

牧云@^-^@ 提交于 2019-12-01 06:33:28
We try to implement long-polling based notification service in our company's ERP. Similar to Facebook notifications. Technologies used: PHP with timeout set to 60 seconds and 1 second sleep in each iteration of loop. jQuery for AJAX handling. Apache as web server. After nearly month of coding, we went to production. Few minutes after deployment we had to rollback everything. It turned out that our server (8 cores) couldn't handle long requests from 20 employees, using ~5 browser tabs each. For example: User opened 3 tabs with our ERP, with one long-polling AJAX on each tab. Opening 4th tab is

Long Polling with Ajax and PHP - Apache freezes

冷暖自知 提交于 2019-12-01 04:13:45
问题 We try to implement long-polling based notification service in our company's ERP. Similar to Facebook notifications. Technologies used: PHP with timeout set to 60 seconds and 1 second sleep in each iteration of loop. jQuery for AJAX handling. Apache as web server. After nearly month of coding, we went to production. Few minutes after deployment we had to rollback everything. It turned out that our server (8 cores) couldn't handle long requests from 20 employees, using ~5 browser tabs each.

Node.js with Socket.io - Long Polling fails and throws “code”:1,“message”:“Session ID unknown” response

血红的双手。 提交于 2019-12-01 03:35:01
I'm stuck on why a node.js app that was moved to an IIS7 server is now failing. I know IIS7 doesn't support web sockets but my understanding was that socket.io would fall back to long polling if web socket isn't available. So now when the user tries to press a specific button which would normally have required the socket or long polling I get something like this: XHR finished loading: POST "https://localhost:817/socket.io/?EIO=2&transport=polling&t=1433777964357-6&sid=QWsESi0c9ih7WMWKAAAC". GET https://localhost:817/socket.io/?EIO=2&transport=polling&t=1433777963494-5&sid=QWsESi0c9ih7WMWKAAAC