diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2024-07-10 18:56:16 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2024-07-10 18:56:16 +0900 |
commit | 252a2ec8b0f0f9cf20c947737087b24a8185b588 (patch) | |
tree | b48be8863db3bc1c223ac270a258b5c1124cb0e3 /doc/html/httpd-example.html | |
parent | 87d29563e3ccdeb7fea0197e262e667ef323ff9c (diff) | |
download | tqt3-252a2ec8b0f0f9cf20c947737087b24a8185b588.tar.gz tqt3-252a2ec8b0f0f9cf20c947737087b24a8185b588.zip |
Rename IO and network class nt* related files to equivalent tq*
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'doc/html/httpd-example.html')
-rw-r--r-- | doc/html/httpd-example.html | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/doc/html/httpd-example.html b/doc/html/httpd-example.html index 1113804c3..6ad8ab235 100644 --- a/doc/html/httpd-example.html +++ b/doc/html/httpd-example.html @@ -33,7 +33,7 @@ body { background: #ffffff; color: black; } <p> -<p> This example shows how to use the <a href="ntqserversocket.html">TQServerSocket</a> class. It is a very +<p> This example shows how to use the <a href="tqserversocket.html">TQServerSocket</a> class. It is a very simple implementation of a HTTP daemon that listens on port 8080 and sends back a simple HTML page back for every GET request it gets. After sending the page, it closes the connection. @@ -49,9 +49,9 @@ sending the page, it closes the connection. ** *****************************************************************************/ #include <stdlib.h> -#include <<a href="qsocket-h.html">ntqsocket.h</a>> +#include <<a href="tqsocket-h.html">tqsocket.h</a>> #include <<a href="tqregexp-h.html">tqregexp.h</a>> -#include <<a href="qserversocket-h.html">ntqserversocket.h</a>> +#include <<a href="tqserversocket-h.html">tqserversocket.h</a>> #include <<a href="qapplication-h.html">ntqapplication.h</a>> #include <<a href="tqmainwindow-h.html">tqmainwindow.h</a>> #include <<a href="tqtextstream-h.html">tqtextstream.h</a>> @@ -61,12 +61,12 @@ sending the page, it closes the connection. #include <<a href="qpushbutton-h.html">ntqpushbutton.h</a>> // HttpDaemon is the the class that implements the simple HTTP server. -class HttpDaemon : public <a href="ntqserversocket.html">TQServerSocket</a> +class HttpDaemon : public <a href="tqserversocket.html">TQServerSocket</a> { <a href="metaobjects.html#TQ_OBJECT">TQ_OBJECT</a> public: HttpDaemon( <a href="tqobject.html">TQObject</a>* parent=0 ) : - <a href="ntqserversocket.html">TQServerSocket</a>(8080,1,parent) + <a href="tqserversocket.html">TQServerSocket</a>(8080,1,parent) { if ( !ok() ) { <a href="ntqapplication.html#qWarning">tqWarning</a>("Failed to bind to port 8080"); @@ -80,10 +80,10 @@ public: // communication with the client is done over this TQSocket. TQSocket // works asynchronouslyl, this means that all the communication is done // in the two slots readClient() and discardClient(). - <a href="ntqsocket.html">TQSocket</a>* s = new <a href="ntqsocket.html">TQSocket</a>( this ); -<a name="x731"></a> connect( s, TQ_SIGNAL(<a href="ntqsocket.html#readyRead">readyRead</a>()), this, TQ_SLOT(readClient()) ); -<a name="x729"></a> connect( s, TQ_SIGNAL(<a href="ntqsocket.html#delayedCloseFinished">delayedCloseFinished</a>()), this, TQ_SLOT(discardClient()) ); -<a name="x732"></a> s-><a href="ntqsocket.html#setSocket">setSocket</a>( socket ); + <a href="tqsocket.html">TQSocket</a>* s = new <a href="tqsocket.html">TQSocket</a>( this ); +<a name="x731"></a> connect( s, TQ_SIGNAL(<a href="tqsocket.html#readyRead">readyRead</a>()), this, TQ_SLOT(readClient()) ); +<a name="x729"></a> connect( s, TQ_SIGNAL(<a href="tqsocket.html#delayedCloseFinished">delayedCloseFinished</a>()), this, TQ_SLOT(discardClient()) ); +<a name="x732"></a> s-><a href="tqsocket.html#setSocket">setSocket</a>( socket ); emit newConnect(); } @@ -98,9 +98,9 @@ private slots: // This slot is called when the client sent data to the server. The // server looks if it was a get request and sends a very simple HTML // document back. - <a href="ntqsocket.html">TQSocket</a>* socket = (TQSocket*)sender(); -<a name="x727"></a> if ( socket-><a href="ntqsocket.html#canReadLine">canReadLine</a>() ) { -<a name="x733"></a><a name="x730"></a> <a href="tqstringlist.html">TQStringList</a> tokens = TQStringList::<a href="tqstringlist.html#split">split</a>( TQRegExp("[ \r\n][ \r\n]*"), socket-><a href="ntqsocket.html#readLine">readLine</a>() ); + <a href="tqsocket.html">TQSocket</a>* socket = (TQSocket*)sender(); +<a name="x727"></a> if ( socket-><a href="tqsocket.html#canReadLine">canReadLine</a>() ) { +<a name="x733"></a><a name="x730"></a> <a href="tqstringlist.html">TQStringList</a> tokens = TQStringList::<a href="tqstringlist.html#split">split</a>( TQRegExp("[ \r\n][ \r\n]*"), socket-><a href="tqsocket.html#readLine">readLine</a>() ); if ( tokens[0] == "GET" ) { <a href="tqtextstream.html">TQTextStream</a> os( socket ); <a name="x735"></a> os.<a href="tqtextstream.html#setEncoding">setEncoding</a>( TQTextStream::UnicodeUTF8 ); @@ -108,14 +108,14 @@ private slots: "Content-Type: text/html; charset=\"utf-8\"\r\n" "\r\n" "<h1>Nothing to see here</h1>\n"; -<a name="x728"></a> socket-><a href="ntqsocket.html#close">close</a>(); +<a name="x728"></a> socket-><a href="tqsocket.html#close">close</a>(); emit wroteToClient(); } } } void discardClient() { - <a href="ntqsocket.html">TQSocket</a>* socket = (TQSocket*)sender(); + <a href="tqsocket.html">TQSocket</a>* socket = (TQSocket*)sender(); delete socket; emit endConnect(); } @@ -136,7 +136,7 @@ public: "This is a small httpd example.\n" "You can connect with your\n" "web browser to port %1" -<a name="x726"></a> ).arg( httpd-><a href="ntqserversocket.html#port">port</a>() ); +<a name="x726"></a> ).arg( httpd-><a href="tqserversocket.html#port">port</a>() ); <a href="ntqlabel.html">TQLabel</a> *lb = new <a href="ntqlabel.html">TQLabel</a>( itext, this ); lb-><a href="ntqlabel.html#setAlignment">setAlignment</a>( AlignHCenter ); infoText = new <a href="tqtextview.html">TQTextView</a>( this ); |