PDA

View Full Version : How a server can write "Hello" to a browser ?



probine
30th November 2006, 15:49
I have simple server that is listening to port 5000. The server is running normally and when a browser sends an http request, then the server is able to read what the browser has sent.

The problem is that I cannot figure out how the server should reply to the browser. Actually, the server is able to reply to a telnet client. Here the problem is that the server replies every time a character is entered in the telnet window.

Back to the problem... how can the server know when to write to the browser, and how ?

sunil.thaha
30th November 2006, 15:53
You can take a look at the Http Sever example provided by Trolls

camel
1st December 2006, 14:43
Back to the problem... how can the server know when to write to the browser, and how ?

Learn about the HTTP protocol. A page that helped me enourmously was
HTTP Made Really Easy (http://www.jmarshall.com/easy/http/)

I have written a HTTP 1.1 Server that integrates nicely with Qt, but I have not yet published it yet (it will be, probably under the LGPL, at some point).

Perhaps if there is demand I will hasten the release. (Problem is in the moment I am missing the "nice" API, and basically all documentation ;-)