MDN may have intermittent access issues April 18 13:00 - April 19 01:00 UTC. See whistlepig.mozilla.org for all notifications.

mozilla

Revision 90515 of NPN_DestroyStream

  • Revision slug: NPN_DestroyStream
  • Revision title: NPN_DestroyStream
  • Revision id: 90515
  • Created:
  • Creator: Pmash
  • Is current revision? No
  • Comment migration

Revision Content

{{wiki.template('Np-plugin-api')}}

Summary

Tells the plug-in that a stream is about to be closed or destroyed.

Syntax

#include <npapi.h>
 
NPError NPP_DestroyStream(NPP       instance, 
                          NPStream* stream, 
                          NPReason  reason);

Parameters

The function has the following parameters:

instance
Pointer to current plug-in instance.
stream
Pointer to current stream.
reason
Reason the stream was destroyed. Values:
  • NPRES_DONE (Most common): Completed normally; all data was sent to the instance.
  • NPRES_USER_BREAK: User canceled stream directly by clicking the Stop button or indirectly by some action such as deleting the instance or initiating higher-priority network operations.
  • NPRES_NETWORK_ERR: Stream failed due to problems with network, disk I/O, lack of memory, or other problems.

Returns

  • If successful, the function returns NPERR_NO_ERROR.
  • If unsuccessful, the plug-in is not loaded and the function returns an error code. For possible values, see Error Codes.

Description

The browser calls the NPP_DestroyStream function when a data stream sent to the plug-in is finished, either because it has completed successfully or terminated abnormally. After this, the browser deletes the NPStream object.

You should delete any private data allocated in stream->pdata at this time, and should not make any further references to the stream object.

See Also

NPP_NewStream, NPP_DestroyStream, NPStream

Revision Source

<p>
{{wiki.template('Np-plugin-api')}}
</p>
<h3 name="Summary">Summary</h3>
<p>Tells the plug-in that a stream is about to be closed or destroyed.
</p>
<h3 name="Syntax">Syntax</h3>
<pre>#include &lt;npapi.h&gt;
 
NPError NPP_DestroyStream(NPP       instance, 
                          NPStream* stream, 
                          NPReason  reason);
</pre>
<h3 name="Parameters">Parameters</h3>
<p>The function has the following parameters:
</p>
<dl><dt>instance
</dt><dd>Pointer to current plug-in instance.
</dd></dl>
<dl><dt>stream	
</dt><dd>Pointer to current stream.
</dd></dl>
<dl><dt>reason
</dt><dd>Reason the stream was destroyed. Values:
<ul><li> NPRES_DONE (Most common): Completed normally; all data was sent to the instance.
</li><li> NPRES_USER_BREAK: User canceled stream directly by clicking the Stop button or indirectly by some action such as deleting the instance or initiating higher-priority network operations.
</li><li> NPRES_NETWORK_ERR: Stream failed due to problems with network, disk I/O, lack of memory, or other problems.
</li></ul>
</dd></dl>
<h3 name="Returns">Returns</h3>
<ul><li> If successful, the function returns NPERR_NO_ERROR.
</li><li> If unsuccessful, the plug-in is not loaded and the function returns an error code. For possible values, see <a href="en/NPAPI/Constants#Error_Codes">Error Codes</a>.
</li></ul>
<h3 name="Description">Description</h3>
<p>The browser calls the <code>NPP_DestroyStream</code> function when a data stream sent to the plug-in is finished, either because it has completed successfully or terminated abnormally. After this, the browser deletes the <a href="en/NPStream">NPStream</a> object.
</p><p>You should delete any private data allocated in <code>stream-&gt;pdata</code> at this time, and should not make any further references to the stream object.
</p>
<h3 name="See_Also">See Also</h3>
<p><a href="en/NPP_NewStream">NPP_NewStream</a>, <a href="en/NPP_DestroyStream">NPP_DestroyStream</a>, <a href="en/NPStream">NPStream</a>
</p>
Revert to this revision