Home > front end >  How long to keep the client and the server connection, ask for help!
How long to keep the client and the server connection, ask for help!

Time:03-21

Background is an embedded system, front-end using jquery, send the request to use ajax, the server is axtls, HTTPS requests are now short connection, according to a certain function, due to slower performance, only to establish a connection to make it, you can cycle request a function (company requires only supports HTTPS, cannot use HTTP), response headers on the server code increases the connection: keep alive, before the finish is to process a request to the server will close the connection, now here also changed, but found that the web client will initiate the next request again, a new connection, is there any way to help leaders ah, every time an ajax request would be to establish a connection?? Hope to solve, thank you

CodePudding user response:

Websocket you're worth it

CodePudding user response:

reference 1st floor against a wall lad response:
websocket you're worth it

Now is mainly the websocket server does not support to us

CodePudding user response:

reference ^_^ ^_^ quietly quietly reply: 3/f
Quote: refer to 1st floor against the wall lad response:
websocket you're worth it

Mainly the websocket server does not support to us now


For what? As long as you server-side language support socket should be no problem

CodePudding user response:

Websocket is not supported, then ajax polling speed point, speed flying

CodePudding user response:

Stupid method with ajax cycle sends the request, the disadvantage is that the time long will appear easily stuck; Or use the websocket connection socket protocol plus heartbeat packets

CodePudding user response:

Ajax polling and long polling

CodePudding user response:

To the HTTP server timeout connection, don't timeout, would have been attached,

CodePudding user response:

Is this how to change, for the first time do not understand
  •  Tags:  
  • Ajax
  • Related