aboutsummaryrefslogtreecommitdiff
path: root/files/tr/web/api/websocket/close/index.html
blob: 44d935c0259711d598d4119ed15c02a69c093d0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
---
title: WebSocket.close()
slug: Web/API/WebSocket/close
tags:
  - API
  - Web API
  - WebSocket
  - Yöntem
translation_of: Web/API/WebSocket/close
---
<p>{{APIRef("Web Sockets API")}}</p>

<p><strong><code>WebSocket.close()</code></strong> yöntemi, eğer varsa, {{domxref("WebSocket")}} bağlantısını kapatır. Eğer bağlantı zaten <code>CLOSED</code> ise, hiç bir şey yapmaz.</p>

<h2 id="Sözdizim">Sözdizim</h2>

<pre class="syntaxbox">WebSocket.close();</pre>

<h3 id="Parametreler">Parametreler</h3>

<dl>
 <dt><code>code</code> {{optional_inline}}</dt>
 <dd>Bir bağlantının neden kapandığını açıklayan durum kodunu belirten bir sayısal değerdir. Eğer parametre belirtilmediyse, varsayılan değer olan <code>1005</code> kullanılır. Ayrıca {{domxref("CloseEvent")}} için izin verilen <a href="/tr/docs/Web/API/CloseEvent#Durum_kodları">durum kodu listesine</a> bakınız.</dd>
</dl>

<dl>
 <dt><code>reason</code> {{optional_inline}}</dt>
 <dd>Neden bağlantının kapandığını belirten okunabilir bir dizidir. Bu dizi 123 byte boyutunda UTF-8 yazısından daha uzun olmamalıdır. <strong>(karakterler değil)</strong></dd>
</dl>

<h3 id="Olağandışı_durumlar">Olağandışı durumlar</h3>

<dl>
 <dt><code>INVALID_ACCESS_ERR</code></dt>
 <dd><code>code</code> parametresine geçersiz bir durum kodu girildi.</dd>
 <dt><code>SYNTAX_ERR</code></dt>
 <dd><code>reason</code> dizisi çok uzun ya da eşleştirilmemiş naipler içeriyor.</dd>
</dl>

<div class="note">
<p><strong>Not:</strong> Gecko'da, bu yöntem 8.0'dan önce hiç bir parametreyi desteklemiyor. {{geckoRelease("8.0")}}.</p>
</div>

<h2 id="Belirtimler">Belirtimler</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th>Belirtim</th>
   <th>Durum</th>
   <th>Yorum</th>
  </tr>
  <tr>
   <td><a class="external external-icon" href="https://html.spec.whatwg.org/multipage/web-sockets.html#dom-websocket-close" hreflang="en" lang="en">HTML Living Standard<br>
    <small lang="en-US">The definition of 'WebSocket.close()' in that specification.</small></a></td>
   <td><span class="spec-Living">Living Standard</span></td>
   <td>İlk tanım</td>
  </tr>
 </tbody>
</table>

<h2 id="Tarayıcı_desteği">Tarayıcı desteği</h2>



<p>{{Compat("api.WebSocket.close")}}</p>