summaryrefslogtreecommitdiffstats
path: root/doc/html/network.html
diff options
context:
space:
mode:
Diffstat (limited to 'doc/html/network.html')
-rw-r--r--doc/html/network.html202
1 files changed, 101 insertions, 101 deletions
diff --git a/doc/html/network.html b/doc/html/network.html
index 72e300f08..4822bea7d 100644
--- a/doc/html/network.html
+++ b/doc/html/network.html
@@ -53,34 +53,34 @@ body { background: #ffffff; color: black; }
</h2>
<a name="1"></a><p> The network module offers classes to make network programming easier
and portable. Essentially, there are three sets of classes, first low
-level classes like <a href="ntqsocket.html">TQSocket</a>, <a href="ntqserversocket.html">TQServerSocket</a>, <a href="ntqdns.html">TQDns</a>, etc. which
+level classes like <a href="tqsocket.html">TQSocket</a>, <a href="tqserversocket.html">TQServerSocket</a>, <a href="tqdns.html">TQDns</a>, etc. which
allow you to work in a portable way with TCP/IP sockets. In addition,
-there are classes like <a href="ntqnetworkprotocol.html">TQNetworkProtocol</a>, <a href="qnetworkoperation.html">TQNetworkOperation</a> in
+there are classes like <a href="tqnetworkprotocol.html">TQNetworkProtocol</a>, <a href="tqnetworkoperation.html">TQNetworkOperation</a> in
the TQt base library, which provide an abstract layer for implementing
-network protocols and <a href="ntqurloperator.html">TQUrlOperator</a> which operates on such network
+network protocols and <a href="tqurloperator.html">TQUrlOperator</a> which operates on such network
protocols. Finally the third set of network classes are the passive
-ones, specifically <a href="ntqurl.html">TQUrl</a> and <a href="ntqurlinfo.html">TQUrlInfo</a> which do URL parsing and
+ones, specifically <a href="tqurl.html">TQUrl</a> and <a href="tqurlinfo.html">TQUrlInfo</a> which do URL parsing and
similar.
-<p> The first set of classes (<a href="ntqsocket.html">TQSocket</a>, <a href="ntqserversocket.html">TQServerSocket</a>, <a href="ntqdns.html">TQDns</a>, <a href="ntqftp.html">TQFtp</a>, etc.) are included in TQt's "network" module.
-<p> The <a href="ntqsocket.html">TQSocket</a> classes are not directly related to the TQNetwork classes,
+<p> The first set of classes (<a href="tqsocket.html">TQSocket</a>, <a href="tqserversocket.html">TQServerSocket</a>, <a href="tqdns.html">TQDns</a>, <a href="tqftp.html">TQFtp</a>, etc.) are included in TQt's "network" module.
+<p> The <a href="tqsocket.html">TQSocket</a> classes are not directly related to the TQNetwork classes,
but TQSocket should and will be used for implementing network
protocols, which are directly related to the TQNetwork classes. For
-example, the <a href="ntqftp.html">TQFtp</a> class (which implements the FTP protocol) uses
+example, the <a href="tqftp.html">TQFtp</a> class (which implements the FTP protocol) uses
TQSockets. But TQSockets don't need to be used for protocol
-implementations, e.g. <a href="ntqlocalfs.html">TQLocalFs</a> (which is an implementation of the
-local filesystem as network protocol) uses <a href="ntqdir.html">TQDir</a> and doesn't use
+implementations, e.g. <a href="tqlocalfs.html">TQLocalFs</a> (which is an implementation of the
+local filesystem as network protocol) uses <a href="tqdir.html">TQDir</a> and doesn't use
TQSocket. Using TQNetworkProtocols you can implement everything which
fits into a hierarchical structure and can be accessed using URLs.
This could be, for example, a protocol which can read pictures from a
digital camera using a serial connection.
-<p> <h2> Working Network Protocol independently with <a href="ntqurloperator.html">TQUrlOperator</a> and <a href="qnetworkoperation.html">TQNetworkOperation</a>
+<p> <h2> Working Network Protocol independently with <a href="tqurloperator.html">TQUrlOperator</a> and <a href="tqnetworkoperation.html">TQNetworkOperation</a>
</h2>
<a name="2"></a><p> It is quite easy to just use existing network protocol implementations
and operate on URLs. For example, downloading a file from an FTP
server to the local filesystem can be done with following code:
<p> <pre>
- <a href="ntqurloperator.html">TQUrlOperator</a> op;
- op.<a href="ntqurloperator.html#copy">copy</a>( "ftp://ftp.trolltech.com/qt/source/qt-2.1.0.tar.gz", "file:/tmp", FALSE );
+ <a href="tqurloperator.html">TQUrlOperator</a> op;
+ op.<a href="tqurloperator.html#copy">copy</a>( "ftp://ftp.trolltech.com/qt/source/qt-2.1.0.tar.gz", "file:/tmp", FALSE );
</pre>
<p> And that's all! Of course an implementation of the FTP protocol has to
@@ -90,48 +90,48 @@ later.
renaming, etc. For example, to create a folder on a private FTP
account do
<p> <pre>
- <a href="ntqurloperator.html">TQUrlOperator</a> op( "ftp://username:password@host.domain.no/home/username" );
- op.<a href="ntqurloperator.html#mkdir">mkdir</a>( "New Directory" );
+ <a href="tqurloperator.html">TQUrlOperator</a> op( "ftp://username:password@host.domain.no/home/username" );
+ op.<a href="tqurloperator.html#mkdir">mkdir</a>( "New Directory" );
</pre>
-<p> To see all available operations, look at the <a href="ntqurloperator.html">TQUrlOperator</a> class
+<p> To see all available operations, look at the <a href="tqurloperator.html">TQUrlOperator</a> class
documentation.
<p> Since networking works asynchronously, the function call for an
operation will normally return before the operation has been
completed. This means that the function cannot return a value
indicating failure or success. Instead, the return value always is a
-pointer to a <a href="qnetworkoperation.html">TQNetworkOperation</a>, and this object stores
+pointer to a <a href="tqnetworkoperation.html">TQNetworkOperation</a>, and this object stores
all the information about the operation.
-<p> For example, <a href="qnetworkoperation.html">TQNetworkOperation</a> has a method which returns the state
+<p> For example, <a href="tqnetworkoperation.html">TQNetworkOperation</a> has a method which returns the state
of this operation. Using this you can find out the state of the
operation at any time. The object also makes available the arguments
-you passed to the <a href="ntqurloperator.html">TQUrlOperator</a> method, the type of the operation
+you passed to the <a href="tqurloperator.html">TQUrlOperator</a> method, the type of the operation
and some more information. For more details see the class
-documentation of <a href="qnetworkoperation.html">TQNetworkOperation</a>.
-<p> The <a href="ntqurloperator.html">TQUrlOperator</a> emits signals to inform you about the progress of
-the operations. As you can call many methods which operate on a <a href="ntqurloperator.html">TQUrlOperator</a>'s URL, it queues up all the operations. So you can't know
-which operation the <a href="ntqurloperator.html">TQUrlOperator</a> just processed. Clearly you will
+documentation of <a href="tqnetworkoperation.html">TQNetworkOperation</a>.
+<p> The <a href="tqurloperator.html">TQUrlOperator</a> emits signals to inform you about the progress of
+the operations. As you can call many methods which operate on a <a href="tqurloperator.html">TQUrlOperator</a>'s URL, it queues up all the operations. So you can't know
+which operation the <a href="tqurloperator.html">TQUrlOperator</a> just processed. Clearly you will
want to know which operation just took place, so each signal's last
-argument is a pointer to the <a href="qnetworkoperation.html">TQNetworkOperation</a> object which was
+argument is a pointer to the <a href="tqnetworkoperation.html">TQNetworkOperation</a> object which was
just processed and which caused the signal to be emitted.
<p> Some of these operations send a <tt>start()</tt> signal at the beginning (if
this makes sense), and some of them send some signals during
processing. All operations send a <tt>finished()</tt> signal after they are
done. To find that out if an operation finished successfully you can
-use the <a href="qnetworkoperation.html">TQNetworkOperation</a> pointer you got with the <tt>finished()</tt>
-signal. If <a href="qnetworkoperation.html#state">TQNetworkOperation::state</a>() equals <a href="ntqnetworkprotocol.html#State-enum">TQNetworkProtocol::StDone</a> the operation finished successfully, if it is
-<a href="ntqnetworkprotocol.html#State-enum">TQNetworkProtocol::StFailed</a> the operation failed.
+use the <a href="tqnetworkoperation.html">TQNetworkOperation</a> pointer you got with the <tt>finished()</tt>
+signal. If <a href="tqnetworkoperation.html#state">TQNetworkOperation::state</a>() equals <a href="tqnetworkprotocol.html#State-enum">TQNetworkProtocol::StDone</a> the operation finished successfully, if it is
+<a href="tqnetworkprotocol.html#State-enum">TQNetworkProtocol::StFailed</a> the operation failed.
<p> Example: A slot which you might connect to the
<tt>TQUrlOperator::finished( TQNetworkOperation * )</tt>
<pre>
-void MyClass::slotOperationFinished( <a href="qnetworkoperation.html">TQNetworkOperation</a> *op )
+void MyClass::slotOperationFinished( <a href="tqnetworkoperation.html">TQNetworkOperation</a> *op )
{
- switch ( op-&gt;<a href="qnetworkoperation.html#operation">operation</a>() ) {
+ switch ( op-&gt;<a href="tqnetworkoperation.html#operation">operation</a>() ) {
case TQNetworkProtocol::OpMkDir:
- if ( op-&gt;<a href="qnetworkoperation.html#state">state</a>() == TQNetworkProtocol::StFailed )
- <a href="ntqapplication.html#qDebug">tqDebug</a>( "Couldn't create directory %s", op-&gt;<a href="qnetworkoperation.html#arg">arg</a>( 0 ).latin1() );
+ if ( op-&gt;<a href="tqnetworkoperation.html#state">state</a>() == TQNetworkProtocol::StFailed )
+ <a href="ntqapplication.html#qDebug">tqDebug</a>( "Couldn't create directory %s", op-&gt;<a href="tqnetworkoperation.html#arg">arg</a>( 0 ).latin1() );
else
- <a href="ntqapplication.html#qDebug">tqDebug</a>( "Successfully created directory %s", op-&gt;<a href="qnetworkoperation.html#arg">arg</a>( 0 ).latin1() );
+ <a href="ntqapplication.html#qDebug">tqDebug</a>( "Successfully created directory %s", op-&gt;<a href="tqnetworkoperation.html#arg">arg</a>( 0 ).latin1() );
break;
// ... and so on
}
@@ -148,33 +148,33 @@ MyClass::MyClass() : <a href="tqobject.html">TQObject</a>(), op( "ftp://ftp.trol
{
connect( &amp;op, TQ_SIGNAL( newChildren( const <a href="tqvaluelist.html">TQValueList</a>&lt;TQUrlInfo&gt; &amp;, TQNetworkOperation * ) ),
this, TQ_SLOT( slotInsertEntries( const <a href="tqvaluelist.html">TQValueList</a>&lt;TQUrlInfo&gt; &amp;, TQNetworkOperation * ) ) );
- connect( &amp;op, TQ_SIGNAL( start( <a href="qnetworkoperation.html">TQNetworkOperation</a> * ) ),
- this, TQ_SLOT( slotStart( <a href="qnetworkoperation.html">TQNetworkOperation</a> *) ) );
- connect( &amp;op, TQ_SIGNAL( finished( <a href="qnetworkoperation.html">TQNetworkOperation</a> * ) ),
- this, TQ_SLOT( slotFinished( <a href="qnetworkoperation.html">TQNetworkOperation</a> *) ) );
+ connect( &amp;op, TQ_SIGNAL( start( <a href="tqnetworkoperation.html">TQNetworkOperation</a> * ) ),
+ this, TQ_SLOT( slotStart( <a href="tqnetworkoperation.html">TQNetworkOperation</a> *) ) );
+ connect( &amp;op, TQ_SIGNAL( finished( <a href="tqnetworkoperation.html">TQNetworkOperation</a> * ) ),
+ this, TQ_SLOT( slotFinished( <a href="tqnetworkoperation.html">TQNetworkOperation</a> *) ) );
}
void MyClass::slotInsertEntries( const <a href="tqvaluelist.html">TQValueList</a>&lt;TQUrlInfo&gt; &amp;info, TQNetworkOperation * )
{
TQValueList&lt;TQUrlInfo&gt;::ConstIterator it = info.<a href="tqvaluelist.html#begin">begin</a>();
for ( ; it != info.<a href="tqvaluelist.html#end">end</a>(); ++it ) {
- const <a href="ntqurlinfo.html">TQUrlInfo</a> &amp;inf = *it;
+ const <a href="tqurlinfo.html">TQUrlInfo</a> &amp;inf = *it;
<a href="ntqapplication.html#qDebug">tqDebug</a>( "Name: %s, Size: %d, Last Modified: %s",
- inf.<a href="ntqurlinfo.html#name">name</a>().latin1(), inf.<a href="ntqurlinfo.html#size">size</a>(), inf.<a href="ntqurlinfo.html#lastModified">lastModified</a>().toString().latin1() );
+ inf.<a href="tqurlinfo.html#name">name</a>().latin1(), inf.<a href="tqurlinfo.html#size">size</a>(), inf.<a href="tqurlinfo.html#lastModified">lastModified</a>().toString().latin1() );
}
}
-void MyClass::slotStart( <a href="qnetworkoperation.html">TQNetworkOperation</a> * )
+void MyClass::slotStart( <a href="tqnetworkoperation.html">TQNetworkOperation</a> * )
{
<a href="ntqapplication.html#qDebug">tqDebug</a>( "Start reading '%s'", op.toString().latin1() );
}
-void MyClass::slotFinished( <a href="qnetworkoperation.html">TQNetworkOperation</a> *operation )
+void MyClass::slotFinished( <a href="tqnetworkoperation.html">TQNetworkOperation</a> *operation )
{
- if ( operation-&gt;<a href="qnetworkoperation.html#operation">operation</a>() == TQNetworkProtocol::OpListChildren ) {
- if ( operation-&gt;<a href="qnetworkoperation.html#state">state</a>() == TQNetworkProtocol::StFailed )
+ if ( operation-&gt;<a href="tqnetworkoperation.html#operation">operation</a>() == TQNetworkProtocol::OpListChildren ) {
+ if ( operation-&gt;<a href="tqnetworkoperation.html#state">state</a>() == TQNetworkProtocol::StFailed )
<a href="ntqapplication.html#qDebug">tqDebug</a>( "Couldn't read '%s'! Following error occurred: %s",
- op.toString().latin1(), operation-&gt;<a href="qnetworkoperation.html#protocolDetail">protocolDetail</a>().latin1() );
+ op.toString().latin1(), operation-&gt;<a href="tqnetworkoperation.html#protocolDetail">protocolDetail</a>().latin1() );
else
<a href="ntqapplication.html#qDebug">tqDebug</a>( "Finished reading '%s'!", op.toString().latin1() );
}
@@ -182,11 +182,11 @@ void MyClass::slotFinished( <a href="qnetworkoperation.html">TQNetworkOperation<
</pre>
-<p> These examples demonstrate now how to use the <a href="ntqurloperator.html">TQUrlOperator</a> and <tt>TQNetworkOperations</tt>. The network extension also contains useful example
+<p> These examples demonstrate now how to use the <a href="tqurloperator.html">TQUrlOperator</a> and <tt>TQNetworkOperations</tt>. The network extension also contains useful example
code.
<p> <h3> Implementing your own Network Protocol
</h3>
-<a name="2-1"></a><p> <a href="ntqnetworkprotocol.html">TQNetworkProtocol</a> provides a base class for implementations
+<a name="2-1"></a><p> <a href="tqnetworkprotocol.html">TQNetworkProtocol</a> provides a base class for implementations
of network protocols and an architecture for the a dynamic
registration and de-registration of network protocols. If you use this
architecture you don't need to care about asynchronous programming, as
@@ -199,31 +199,31 @@ hierarchical structure and accessed via URLs, can be implemented as
network protocol and easily used in TQt. This is not limited to
filesystems only!
<p> To implement a network protocol create a class derived from
-<a href="ntqnetworkprotocol.html">TQNetworkProtocol</a>.
+<a href="tqnetworkprotocol.html">TQNetworkProtocol</a>.
<p> Other classes will use this network protocol implementation
to operate on it. So you should reimplement following protected members
<p> <pre>
- void TQNetworkProtocol::operationListChildren( <a href="qnetworkoperation.html">TQNetworkOperation</a> *op );
- void TQNetworkProtocol::operationMkDir( <a href="qnetworkoperation.html">TQNetworkOperation</a> *op );
- void TQNetworkProtocol::operationRemove( <a href="qnetworkoperation.html">TQNetworkOperation</a> *op );
- void TQNetworkProtocol::operationRename( <a href="qnetworkoperation.html">TQNetworkOperation</a> *op );
- void TQNetworkProtocol::operationGet( <a href="qnetworkoperation.html">TQNetworkOperation</a> *op );
- void TQNetworkProtocol::operationPut( <a href="qnetworkoperation.html">TQNetworkOperation</a> *op );
+ void TQNetworkProtocol::operationListChildren( <a href="tqnetworkoperation.html">TQNetworkOperation</a> *op );
+ void TQNetworkProtocol::operationMkDir( <a href="tqnetworkoperation.html">TQNetworkOperation</a> *op );
+ void TQNetworkProtocol::operationRemove( <a href="tqnetworkoperation.html">TQNetworkOperation</a> *op );
+ void TQNetworkProtocol::operationRename( <a href="tqnetworkoperation.html">TQNetworkOperation</a> *op );
+ void TQNetworkProtocol::operationGet( <a href="tqnetworkoperation.html">TQNetworkOperation</a> *op );
+ void TQNetworkProtocol::operationPut( <a href="tqnetworkoperation.html">TQNetworkOperation</a> *op );
</pre>
<p> Some notes on reimplementing these methods: You always get a pointer
-to a <a href="qnetworkoperation.html">TQNetworkOperation</a> as argument. This pointer holds all the
+to a <a href="tqnetworkoperation.html">TQNetworkOperation</a> as argument. This pointer holds all the
information about the operation in the current state. If you start
-processing such an operation, set the state to <a href="ntqnetworkprotocol.html#State-enum">TQNetworkProtocol::StInProgress</a>. If you finished processing the
-operation, set the state to <a href="ntqnetworkprotocol.html#State-enum">TQNetworkProtocol::StDone</a> if it was
-successful or <a href="ntqnetworkprotocol.html#State-enum">TQNetworkProtocol::StFailed</a> if an error occurred. If
+processing such an operation, set the state to <a href="tqnetworkprotocol.html#State-enum">TQNetworkProtocol::StInProgress</a>. If you finished processing the
+operation, set the state to <a href="tqnetworkprotocol.html#State-enum">TQNetworkProtocol::StDone</a> if it was
+successful or <a href="tqnetworkprotocol.html#State-enum">TQNetworkProtocol::StFailed</a> if an error occurred. If
an error occurred you must set an error code (see
-<a href="qnetworkoperation.html#setErrorCode">TQNetworkOperation::setErrorCode</a>()) and if you know some details
+<a href="tqnetworkoperation.html#setErrorCode">TQNetworkOperation::setErrorCode</a>()) and if you know some details
(e.g. an error message) you can also set this message to the operation
-pointer (see <a href="qnetworkoperation.html#setProtocolDetail">TQNetworkOperation::setProtocolDetail</a>()). Also you get
+pointer (see <a href="tqnetworkoperation.html#setProtocolDetail">TQNetworkOperation::setProtocolDetail</a>()). Also you get
all the relevant information (type, arguments, etc.) about the
-operation from the <a href="qnetworkoperation.html">TQNetworkOperation</a> pointer. For details about
-which arguments you can get and set look at <a href="qnetworkoperation.html">TQNetworkOperation</a>'s
+operation from the <a href="tqnetworkoperation.html">TQNetworkOperation</a> pointer. For details about
+which arguments you can get and set look at <a href="tqnetworkoperation.html">TQNetworkOperation</a>'s
class documentation.
<p> If you reimplement an operation function, it's very important to emit
the correct signals at the correct time: In general always emit <tt>finished()</tt> at the end of an operation (when you either successfully
@@ -269,10 +269,10 @@ to the user.
</ul>
</ul>
<p> And remember, always emit the <tt>finished()</tt> signal at the end!
-<p> For more details about these signals' arguments look at the <a href="ntqnetworkprotocol.html">TQNetworkProtocol</a> class documentation.
-<p> Here is a list of which <a href="qnetworkoperation.html">TQNetworkOperation</a> arguments you can get and
+<p> For more details about these signals' arguments look at the <a href="tqnetworkprotocol.html">TQNetworkProtocol</a> class documentation.
+<p> Here is a list of which <a href="tqnetworkoperation.html">TQNetworkOperation</a> arguments you can get and
which you must set in which function:
-<p> (To get the URL on which you should work, use the <a href="ntqnetworkprotocol.html#url">TQNetworkProtocol::url</a>() method which returns a pointer to the URL
+<p> (To get the URL on which you should work, use the <a href="tqnetworkprotocol.html#url">TQNetworkProtocol::url</a>() method which returns a pointer to the URL
operator. Using that you can get the path, host, name filter, etc.)
<p> <ul>
<li> In <tt>operationListChildren</tt>:
@@ -287,7 +287,7 @@ operator. Using that you can get the path, host, name filter, etc.)
<ul>
<li> <tt>TQNetworkOperation::arg( 0 )</tt> contains the name of the file
which should be removed. Normally this is a relative name. But
-it could be absolute. Use <a href="ntqurl.html">TQUrl</a>( op->arg( 0 ) ).fileName()
+it could be absolute. Use <a href="tqurl.html">TQUrl</a>( op->arg( 0 ) ).fileName()
to get the filename.
</ul>
<li> In <tt>operationRename</tt>:
@@ -312,8 +312,8 @@ should be stored in <tt>TQNetworkOperation::arg( 0 )</tt>
</ul>
<p> In summary: If you reimplement an operation function, you must emit
some special signals and at the end you must <em>always</em> emit a <tt>finished()</tt> signal, regardless of success or failure. Also you must
-change the state of the <a href="qnetworkoperation.html">TQNetworkOperation</a> during processing. You
-can also get and set <a href="qnetworkoperation.html">TQNetworkOperation</a> arguments as the operation
+change the state of the <a href="tqnetworkoperation.html">TQNetworkOperation</a> during processing. You
+can also get and set <a href="tqnetworkoperation.html">TQNetworkOperation</a> arguments as the operation
progresses.
<p> It may occur that the network protocol you implement only requires a
subset of these operations. In such cases, simply reimplement the
@@ -326,7 +326,7 @@ reimplementing
<p> In your implementation of this method return an <tt>int</tt> value
which is constructed by OR-ing together the correct values
-(supported operations) of the following enum (of <a href="ntqnetworkprotocol.html">TQNetworkProtocol</a>):
+(supported operations) of the following enum (of <a href="tqnetworkprotocol.html">TQNetworkProtocol</a>):
<p> <ul>
<li> <tt>OpListChildren</tt>
<li> <tt>OpMkDir</tt>
@@ -343,84 +343,84 @@ them, your implementation of <tt>supportedOperations()</tt> should do this:
<p> The last method you must reimplement is
<p> <pre>
- bool TQNetworkProtocol::checkConnection( <a href="qnetworkoperation.html">TQNetworkOperation</a> *op );
+ bool TQNetworkProtocol::checkConnection( <a href="tqnetworkoperation.html">TQNetworkOperation</a> *op );
</pre>
<p> Here you must return TRUE, if the connection is up and okay (this means
operations on the protocol can be done). If the connection is not okay,
return FALSE and start to try opening it. If you cannot open the
connection at all (e.g. because the host is not found), emit a <tt>finished()</tt>
-signal and set an error code and the <a href="ntqnetworkprotocol.html#State-enum">TQNetworkProtocol::StFailed</a> state to
-the <a href="qnetworkoperation.html">TQNetworkOperation</a> pointer you get here.
+signal and set an error code and the <a href="tqnetworkprotocol.html#State-enum">TQNetworkProtocol::StFailed</a> state to
+the <a href="tqnetworkoperation.html">TQNetworkOperation</a> pointer you get here.
<p> Now, you never need to check before doing an operation yourself, if
the connection is okay. The network architecture does this, which
means it uses <tt>checkConnection()</tt> to see if an operation can be done
and if not, it tries it again and again for some time, only calling an
operation function if the connection is okay.
-<p> To be able to use a network protocol with a <a href="ntqurloperator.html">TQUrlOperator</a> (and so, for
-example, in the <a href="ntqfiledialog.html">TQFileDialog</a>), you must register the network
+<p> To be able to use a network protocol with a <a href="tqurloperator.html">TQUrlOperator</a> (and so, for
+example, in the <a href="tqfiledialog.html">TQFileDialog</a>), you must register the network
protocol implementation. This can be done like this:
<p> <pre>
- TQNetworkProtocol::<a href="ntqnetworkprotocol.html#registerNetworkProtocol">registerNetworkProtocol</a>( "myprot", new TQNetworkProtocolFactory&lt;MyProtocol&gt; );
+ TQNetworkProtocol::<a href="tqnetworkprotocol.html#registerNetworkProtocol">registerNetworkProtocol</a>( "myprot", new TQNetworkProtocolFactory&lt;MyProtocol&gt; );
</pre>
<p> In this case <tt>MyProtocol</tt> would be a class you implemented as
-described here (derived from <a href="ntqnetworkprotocol.html">TQNetworkProtocol</a>) and the name of the
+described here (derived from <a href="tqnetworkprotocol.html">TQNetworkProtocol</a>) and the name of the
protocol would be "myprot". So to use it, you would do something like
<p> <pre>
- <a href="ntqurloperator.html">TQUrlOperator</a> op( "myprot://host/path" );
- op.<a href="ntqurloperator.html#listChildren">listChildren</a>();
+ <a href="tqurloperator.html">TQUrlOperator</a> op( "myprot://host/path" );
+ op.<a href="tqurloperator.html#listChildren">listChildren</a>();
</pre>
<p> Finally, as example of a network protocol implementation you could
-look at the implementation of <a href="ntqlocalfs.html">TQLocalFs</a>. The network extension also
+look at the implementation of <a href="tqlocalfs.html">TQLocalFs</a>. The network extension also
contains an example implementation of a network protocol.
<p> <h3> Error Handling
</h3>
<a name="2-2"></a><p> Error handling is important for both implementing new network
-protocols for and using them (through <a href="ntqurloperator.html">TQUrlOperator</a>).
+protocols for and using them (through <a href="tqurloperator.html">TQUrlOperator</a>).
<p> After processing an operation has been finished the network operation
-the <a href="ntqurloperator.html">TQUrlOperator</a> emits the <tt>finished()</tt> signal. This has as argument
-a pointer to the processed <a href="qnetworkoperation.html">TQNetworkOperation</a>. If the state of this
-operation is <a href="ntqnetworkprotocol.html#State-enum">TQNetworkProtocol::StFailed</a>, the operation contains
+the <a href="tqurloperator.html">TQUrlOperator</a> emits the <tt>finished()</tt> signal. This has as argument
+a pointer to the processed <a href="tqnetworkoperation.html">TQNetworkOperation</a>. If the state of this
+operation is <a href="tqnetworkprotocol.html#State-enum">TQNetworkProtocol::StFailed</a>, the operation contains
some more information about this error. The following error codes are
-defined in <a href="ntqnetworkprotocol.html">TQNetworkProtocol</a>:
+defined in <a href="tqnetworkprotocol.html">TQNetworkProtocol</a>:
<p> <center><table cellpadding="4" cellspacing="2" border="0">
<tr bgcolor="#a2c511"> <th valign="top">Error <th valign="top">Meaning
-<tr bgcolor="#f0f0f0"> <td valign="top"><a href="ntqnetworkprotocol.html#Error-enum">TQNetworkProtocol::NoError</a>
+<tr bgcolor="#f0f0f0"> <td valign="top"><a href="tqnetworkprotocol.html#Error-enum">TQNetworkProtocol::NoError</a>
<td valign="top">No error occurred
-<tr bgcolor="#d0d0d0"> <td valign="top"><a href="ntqnetworkprotocol.html#Error-enum">TQNetworkProtocol::ErrValid</a>
+<tr bgcolor="#d0d0d0"> <td valign="top"><a href="tqnetworkprotocol.html#Error-enum">TQNetworkProtocol::ErrValid</a>
<td valign="top">The URL you are operating on is not valid
-<tr bgcolor="#f0f0f0"> <td valign="top"><a href="ntqnetworkprotocol.html#Error-enum">TQNetworkProtocol::ErrUnknownProtocol</a>
+<tr bgcolor="#f0f0f0"> <td valign="top"><a href="tqnetworkprotocol.html#Error-enum">TQNetworkProtocol::ErrUnknownProtocol</a>
<td valign="top">There is no protocol implementation available for the protocol
of the URL you are operating on (e.g. if the protocol is http
and no http implementation has been registered)
-<tr bgcolor="#d0d0d0"> <td valign="top"><a href="ntqnetworkprotocol.html#Error-enum">TQNetworkProtocol::ErrUnsupported</a>
+<tr bgcolor="#d0d0d0"> <td valign="top"><a href="tqnetworkprotocol.html#Error-enum">TQNetworkProtocol::ErrUnsupported</a>
<td valign="top">The operation is not supported by the protocol
-<tr bgcolor="#f0f0f0"> <td valign="top"><a href="ntqnetworkprotocol.html#Error-enum">TQNetworkProtocol::ErrParse</a>
+<tr bgcolor="#f0f0f0"> <td valign="top"><a href="tqnetworkprotocol.html#Error-enum">TQNetworkProtocol::ErrParse</a>
<td valign="top">Parse error of the URL
-<tr bgcolor="#d0d0d0"> <td valign="top"><a href="ntqnetworkprotocol.html#Error-enum">TQNetworkProtocol::ErrLoginIncorrect</a>
+<tr bgcolor="#d0d0d0"> <td valign="top"><a href="tqnetworkprotocol.html#Error-enum">TQNetworkProtocol::ErrLoginIncorrect</a>
<td valign="top">You needed to login but the username or password are wrong
-<tr bgcolor="#f0f0f0"> <td valign="top"><a href="ntqnetworkprotocol.html#Error-enum">TQNetworkProtocol::ErrHostNotFound</a>
+<tr bgcolor="#f0f0f0"> <td valign="top"><a href="tqnetworkprotocol.html#Error-enum">TQNetworkProtocol::ErrHostNotFound</a>
<td valign="top">The specified host (in the URL) couldn't be found
-<tr bgcolor="#d0d0d0"> <td valign="top"><a href="ntqnetworkprotocol.html#Error-enum">TQNetworkProtocol::ErrListChildren</a>
+<tr bgcolor="#d0d0d0"> <td valign="top"><a href="tqnetworkprotocol.html#Error-enum">TQNetworkProtocol::ErrListChildren</a>
<td valign="top">An error occurred while listing the children
-<tr bgcolor="#f0f0f0"> <td valign="top"><a href="ntqnetworkprotocol.html#Error-enum">TQNetworkProtocol::ErrMkDir</a>
+<tr bgcolor="#f0f0f0"> <td valign="top"><a href="tqnetworkprotocol.html#Error-enum">TQNetworkProtocol::ErrMkDir</a>
<td valign="top">An error occurred when creating a directory
-<tr bgcolor="#d0d0d0"> <td valign="top"><a href="ntqnetworkprotocol.html#Error-enum">TQNetworkProtocol::ErrRemove</a>
+<tr bgcolor="#d0d0d0"> <td valign="top"><a href="tqnetworkprotocol.html#Error-enum">TQNetworkProtocol::ErrRemove</a>
<td valign="top">An error occurred while removing a child
-<tr bgcolor="#f0f0f0"> <td valign="top"><a href="ntqnetworkprotocol.html#Error-enum">TQNetworkProtocol::ErrRename</a>
+<tr bgcolor="#f0f0f0"> <td valign="top"><a href="tqnetworkprotocol.html#Error-enum">TQNetworkProtocol::ErrRename</a>
<td valign="top">An error occurred while renaming a child
-<tr bgcolor="#d0d0d0"> <td valign="top"><a href="ntqnetworkprotocol.html#Error-enum">TQNetworkProtocol::ErrGet</a>
+<tr bgcolor="#d0d0d0"> <td valign="top"><a href="tqnetworkprotocol.html#Error-enum">TQNetworkProtocol::ErrGet</a>
<td valign="top">An error occurred while getting (retrieving) data
-<tr bgcolor="#f0f0f0"> <td valign="top"><a href="ntqnetworkprotocol.html#Error-enum">TQNetworkProtocol::ErrPut</a>
+<tr bgcolor="#f0f0f0"> <td valign="top"><a href="tqnetworkprotocol.html#Error-enum">TQNetworkProtocol::ErrPut</a>
<td valign="top">An error occurred while putting (uploading) data
-<tr bgcolor="#d0d0d0"> <td valign="top"><a href="ntqnetworkprotocol.html#Error-enum">TQNetworkProtocol::ErrFileNotExisting</a>
+<tr bgcolor="#d0d0d0"> <td valign="top"><a href="tqnetworkprotocol.html#Error-enum">TQNetworkProtocol::ErrFileNotExisting</a>
<td valign="top">A file which is needed by the operation doesn't exist
-<tr bgcolor="#f0f0f0"> <td valign="top"><a href="ntqnetworkprotocol.html#Error-enum">TQNetworkProtocol::ErrPermissionDenied</a>
+<tr bgcolor="#f0f0f0"> <td valign="top"><a href="tqnetworkprotocol.html#Error-enum">TQNetworkProtocol::ErrPermissionDenied</a>
<td valign="top">The permission for doing the operation has been denied
</table></center>
-<p> <a href="qnetworkoperation.html#errorCode">TQNetworkOperation::errorCode</a>() returns one of these codes or
+<p> <a href="tqnetworkoperation.html#errorCode">TQNetworkOperation::errorCode</a>() returns one of these codes or
perhaps a different one if you use your an own network protocol
implementation which defines additional error codes.
<p> <tt>TQNetworkOperation::protocolDetails()</tt> may also return a string which
@@ -428,7 +428,7 @@ contains an error message then which might be suitable for display to
the user.
<p> If you implement your own network protocol, you must report any
errors which occurred. First you always need to be able to
-access the <a href="qnetworkoperation.html">TQNetworkOperation</a> which is being processed at the
+access the <a href="tqnetworkoperation.html">TQNetworkOperation</a> which is being processed at the
moment. This is done using <tt>TQNetworkOperation::operationInProgress()</tt>, which returns a pointer to
the current network operation or 0 if no operation is processed at the
moment.
@@ -442,18 +442,18 @@ moment.
}
</pre>
-<p> That's all. The connection to the <a href="ntqurloperator.html">TQUrlOperator</a> and so on is done
+<p> That's all. The connection to the <a href="tqurloperator.html">TQUrlOperator</a> and so on is done
automatically. Additionally, if the error was really bad so that no
more operations can be done in the current state (e.g. if the host
couldn't be found), call <tt>TQNetworkProtocol::clearOperationStack()</tt> <em>before</em> emitting <tt>finished()</tt>.
-<p> Ideally you should use one of the predefined error codes of <a href="ntqnetworkprotocol.html">TQNetworkProtocol</a>. If this is not possible, you can add own error codes
+<p> Ideally you should use one of the predefined error codes of <a href="tqnetworkprotocol.html">TQNetworkProtocol</a>. If this is not possible, you can add own error codes
- they are just normal <tt>int</tt>s. Just be careful that the value of the
error code doesn't conflict with an existing one.
<p> An example to look at is in qt/examples/network/ftpclient.
This is the implementation of a fairly complete FTP client, which
supports uploading and downloading files, making directories, etc.,
all done using <tt>TQUrlOperators</tt>.
-<p> You might also like to look at <a href="ntqftp.html">TQFtp</a> (in qt/src/network/qftp.cpp) or at
+<p> You might also like to look at <a href="tqftp.html">TQFtp</a> (in qt/src/network/tqftp.cpp) or at
the example in qt/examples/network/networkprotocol/nntp.cpp.
<p>
<!-- eof -->