diff options
Diffstat (limited to 'doc/html/clientserver-example.html')
-rw-r--r-- | doc/html/clientserver-example.html | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/doc/html/clientserver-example.html b/doc/html/clientserver-example.html index d44930b68..d4bcd90bd 100644 --- a/doc/html/clientserver-example.html +++ b/doc/html/clientserver-example.html @@ -35,8 +35,8 @@ body { background: #ffffff; color: black; } <p> <p> This example shows how two programs can communicate using sockets. <p> Two simple example programs are provided, a client program and a -server program. Both use the <a href="ntqsocket.html">TQSocket</a> class, and the server also uses -<a href="ntqserversocket.html">TQServerSocket</a> class. +server program. Both use the <a href="tqsocket.html">TQSocket</a> class, and the server also uses +<a href="tqserversocket.html">TQServerSocket</a> class. <p> The server listens on port number 4242 and accepts incoming connections. It sends back every line it receives from the client, prepended with the line number. @@ -55,8 +55,8 @@ specified. You can send single lines to the server. ** *****************************************************************************/ -#include <<a href="qsocket-h.html">ntqsocket.h</a>> -#include <<a href="qserversocket-h.html">ntqserversocket.h</a>> +#include <<a href="tqsocket-h.html">tqsocket.h</a>> +#include <<a href="tqserversocket-h.html">tqserversocket.h</a>> #include <<a href="qapplication-h.html">ntqapplication.h</a>> #include <<a href="qvbox-h.html">ntqvbox.h</a>> #include <<a href="tqtextview-h.html">tqtextview.h</a>> @@ -72,12 +72,12 @@ specified. You can send single lines to the server. For every client that connects to the server, the server creates a new instance of this class. */ -class ClientSocket : public <a href="ntqsocket.html">TQSocket</a> +class ClientSocket : public <a href="tqsocket.html">TQSocket</a> { <a href="metaobjects.html#TQ_OBJECT">TQ_OBJECT</a> public: ClientSocket( int sock, TQObject *parent=0, const char *name=0 ) : - <a href="ntqsocket.html">TQSocket</a>( parent, name ) + <a href="tqsocket.html">TQSocket</a>( parent, name ) { line = 0; connect( this, TQ_SIGNAL(readyRead()), @@ -119,12 +119,12 @@ private: client that connects, it creates a new ClientSocket -- that instance is now responsible for the communication with that client. */ -class SimpleServer : public <a href="ntqserversocket.html">TQServerSocket</a> +class SimpleServer : public <a href="tqserversocket.html">TQServerSocket</a> { TQ_OBJECT public: SimpleServer( <a href="tqobject.html">TQObject</a>* parent=0 ) : - <a href="ntqserversocket.html">TQServerSocket</a>( 4242, 1, parent ) + <a href="tqserversocket.html">TQServerSocket</a>( 4242, 1, parent ) { if ( !ok() ) { <a href="ntqapplication.html#qWarning">tqWarning</a>("Failed to bind to port 4242"); @@ -184,7 +184,7 @@ private slots: <a name="x786"></a> infoText-><a href="tqtextedit.html#append">append</a>( tr("New connection\n") ); connect( s, TQ_SIGNAL(logText(const <a href="tqstring.html">TQString</a>&)), infoText, TQ_SLOT(<a href="tqtextedit.html#append">append</a>(const <a href="tqstring.html">TQString</a>&)) ); -<a name="x785"></a> connect( s, TQ_SIGNAL(<a href="ntqsocket.html#connectionClosed">connectionClosed</a>()), +<a name="x785"></a> connect( s, TQ_SIGNAL(<a href="tqsocket.html#connectionClosed">connectionClosed</a>()), TQ_SLOT(connectionClosed()) ); } @@ -222,7 +222,7 @@ int main( int argc, char** argv ) ** *****************************************************************************/ -#include <<a href="qsocket-h.html">ntqsocket.h</a>> +#include <<a href="tqsocket-h.html">tqsocket.h</a>> #include <<a href="qapplication-h.html">ntqapplication.h</a>> #include <<a href="qvbox-h.html">ntqvbox.h</a>> #include <<a href="qhbox-h.html">ntqhbox.h</a>> @@ -252,19 +252,19 @@ public: connect( quit, TQ_SIGNAL(<a href="ntqbutton.html#clicked">clicked</a>()), tqApp, TQ_SLOT(<a href="ntqapplication.html#quit">quit</a>()) ); // create the socket and connect various of its signals - socket = new <a href="ntqsocket.html">TQSocket</a>( this ); -<a name="x798"></a> connect( socket, TQ_SIGNAL(<a href="ntqsocket.html#connected">connected</a>()), + socket = new <a href="tqsocket.html">TQSocket</a>( this ); +<a name="x798"></a> connect( socket, TQ_SIGNAL(<a href="tqsocket.html#connected">connected</a>()), TQ_SLOT(socketConnected()) ); -<a name="x799"></a> connect( socket, TQ_SIGNAL(<a href="ntqsocket.html#connectionClosed">connectionClosed</a>()), +<a name="x799"></a> connect( socket, TQ_SIGNAL(<a href="tqsocket.html#connectionClosed">connectionClosed</a>()), TQ_SLOT(socketConnectionClosed()) ); -<a name="x803"></a> connect( socket, TQ_SIGNAL(<a href="ntqsocket.html#readyRead">readyRead</a>()), +<a name="x803"></a> connect( socket, TQ_SIGNAL(<a href="tqsocket.html#readyRead">readyRead</a>()), TQ_SLOT(socketReadyRead()) ); -<a name="x801"></a> connect( socket, TQ_SIGNAL(<a href="ntqsocket.html#error">error</a>(int)), +<a name="x801"></a> connect( socket, TQ_SIGNAL(<a href="tqsocket.html#error">error</a>(int)), TQ_SLOT(socketError(int)) ); // connect to the server <a name="x805"></a> infoText-><a href="tqtextedit.html#append">append</a>( tr("Trying to connect to the server\n") ); -<a name="x797"></a> socket-><a href="ntqsocket.html#connectToHost">connectToHost</a>( host, port ); +<a name="x797"></a> socket-><a href="tqsocket.html#connectToHost">connectToHost</a>( host, port ); } ~Client() @@ -274,10 +274,10 @@ public: private slots: void closeConnection() { -<a name="x796"></a> socket-><a href="ntqsocket.html#close">close</a>(); -<a name="x804"></a> if ( socket-><a href="ntqsocket.html#state">state</a>() == TQSocket::Closing ) { +<a name="x796"></a> socket-><a href="tqsocket.html#close">close</a>(); +<a name="x804"></a> if ( socket-><a href="tqsocket.html#state">state</a>() == TQSocket::Closing ) { // We have a delayed close. -<a name="x800"></a> connect( socket, TQ_SIGNAL(<a href="ntqsocket.html#delayedCloseFinished">delayedCloseFinished</a>()), +<a name="x800"></a> connect( socket, TQ_SIGNAL(<a href="tqsocket.html#delayedCloseFinished">delayedCloseFinished</a>()), TQ_SLOT(socketClosed()) ); } else { // The socket is closed. @@ -296,8 +296,8 @@ private slots: void socketReadyRead() { // read from the server -<a name="x795"></a> while ( socket-><a href="ntqsocket.html#canReadLine">canReadLine</a>() ) { -<a name="x802"></a> infoText-><a href="tqtextedit.html#append">append</a>( socket-><a href="ntqsocket.html#readLine">readLine</a>() ); +<a name="x795"></a> while ( socket-><a href="tqsocket.html#canReadLine">canReadLine</a>() ) { +<a name="x802"></a> infoText-><a href="tqtextedit.html#append">append</a>( socket-><a href="tqsocket.html#readLine">readLine</a>() ); } } @@ -322,7 +322,7 @@ private slots: } private: - <a href="ntqsocket.html">TQSocket</a> *socket; + <a href="tqsocket.html">TQSocket</a> *socket; <a href="tqtextview.html">TQTextView</a> *infoText; <a href="ntqlineedit.html">TQLineEdit</a> *inputText; }; |