Что точно означает “постоянное соединение”?

Моно содержит поставщика ADO.NET, который должен сделать это для Вас. Я не знаю, существует ли утилита командной строки для него, но Вы могли бы определенно обернуть некоторый C#, чтобы сделать запросы, если нет.

Взглянули на http://www.mono-project.com/TDS_Providers и http://www.mono-project.com/SQLClient

21
задан Kevin Boyd 26 September 2009 в 03:11
поделиться

2 ответа

All the discussion till now has been from the browser side of things. The browser first request the actual page, and it parses the page and finds out all other resources that it needs before it can render that page. The browser requests these resources and other dependent resources one by one. So maintaining a persistent connection is very efficient here, as the overhead of creating and destroying connections is avoided.

Now from web server side of things, a persistent connection would be one that allows it to "push" content to the web browser. Now HTTP doesn't support this. So, there are few workarounds with javascript where the page is basically refreshed after a while.

You can see this being trick being used by many web based email providers which continuously keep checking in the background for new mails. This gives a feeling that when a new mails arrives, the server "pushes" the new mail notification to the web browser. But in fact, its actually the web browser which keeps on checking the server for any new mail.

Also another point that I would like to state is that we actually don't see any page refresh that's because of another trick which allows only specific parts of the page to be refreshed by the request. (HINT: AJAX)

20
ответ дан 29 November 2019 в 20:06
поделиться

Это означает, что сервер не ' t закрыть сокет, как только он завершит отправку ответа (так что длину ответа нужно указать иначе, через заголовки или фрагменты), чтобы клиент мог делать другие запросы к тому же сокету. Веб-страница часто запрашивает несколько других частей (изображения, CSS, сценарии и т. Д.) На том же сервере, что и сама страница, поэтому повторное использование сокета для некоторых из этих дальнейших запросов к тому же серверу может уменьшить общую задержку по сравнению с закрытием исходный сокет и открытие новых для всех последующих запросов.

29
ответ дан 29 November 2019 в 20:06
поделиться
Другие вопросы по тегам:

Похожие вопросы: