TCPSocket.onclose

  • Revision slug: Web/API/TCPSocket.onclose
  • Revision title: TCPSocket.onclose
  • Revision id: 429447
  • Created:
  • Creator: Jeremie
  • Is current revision? No
  • Comment

Revision Content

{{ domref() }}

{{ non-standard_header() }}

{{ B2GOnlyHeader2('privileged') }}

Summary

The onclose property is used to specify an event handler to receive {{event("close")}} events. Those events are triggered when the server or the client (with the {{domxref("TCPSocket.close","close()")}} method) close the connexion.

Syntax

instanceOfTCPSocket.onclose = funcRef

Where funcRef is a function to be called when the {{event("close")}} event occurs.

This callback function will get a {{Anch("TCPSocketEvent")}} objet as its first parameters.

TCPSocketEvent

{{page("/en-US/docs/Web/API/TCPSocket.onopen","TCPSocketEvent")}}

Specification

Not part of any specification yet; however, this API is discussed at W3C as part of the System Applications Working Group under the Raw Sockets proposal.

See also

Revision Source

<p>{{ domref() }}</p>
<p>{{ non-standard_header() }}</p>
<p>{{ B2GOnlyHeader2('privileged') }}</p>
<h2 id="Summary">Summary</h2>
<p>The <code>onclose</code> property is used to specify an event handler to receive {{event("close")}} events. Those events are triggered when the server or the client (with the {{domxref("TCPSocket.close","close()")}} method) close the connexion.</p>
<h2 id="Syntax">Syntax</h2>
<pre>
<em>instanceOfTCPSocket</em>.onclose = <em>funcRef</em></pre>
<p>Where <code><em>funcRef</em></code> is a function to be called when the {{event("close")}} event occurs.</p>
<p>This callback function will get a {{Anch("TCPSocketEvent")}} objet as its first parameters.</p>
<h3 id="TCPSocketEvent">TCPSocketEvent</h3>
<p>{{page("/en-US/docs/Web/API/TCPSocket.onopen","TCPSocketEvent")}}</p>
<h2 id="Specification">Specification</h2>
<p>Not part of any specification yet; however, this API is discussed at W3C as part of the <a class="external" href="http://www.w3.org/2012/sysapps/" rel="external" title="http://www.w3.org/2012/sysapps/">System Applications Working Group</a> under the <a href="http://www.w3.org/2012/sysapps/raw-sockets/" title="http://www.w3.org/2012/sysapps/raw-sockets/">Raw Sockets</a> proposal.</p>
<h2 id="See_also">See also</h2>
<ul>
  <li>{{domxref("TCPSocket")}}</li>
  <li><a href="/en-US/docs/WebAPI/TCP_Socket" title="/en-US/docs/WebAPI/TCP_Socket">TCP Socket</a></li>
</ul>
Revert to this revision