diff options
Diffstat (limited to 'files/tr/web/api/websocket/index.html')
| -rw-r--r-- | files/tr/web/api/websocket/index.html | 138 |
1 files changed, 0 insertions, 138 deletions
diff --git a/files/tr/web/api/websocket/index.html b/files/tr/web/api/websocket/index.html deleted file mode 100644 index ce8a030def..0000000000 --- a/files/tr/web/api/websocket/index.html +++ /dev/null @@ -1,138 +0,0 @@ ---- -title: WebSocket -slug: Web/API/WebSocket -tags: - - API - - WebSocket - - WebSockets -translation_of: Web/API/WebSocket ---- -<div>{{APIRef("Web Sockets API")}}</div> - -<p><code>WebSocket</code>, bir <a href="/en-US/docs/Web/API/WebSockets_API">WebSocket</a> sunucusuyla bağlantı kurmak ve bağlantıyı yönetmek için bir uygulama programlama arayüzü (API) sunar.</p> - -<p><code>WebSocket</code>'i kurmak için <code><a href="/en-US/docs/Web/API/WebSocket/WebSocket">WebSocket()</a></code> yapısını kullanın.</p> - -<h2 id="Yapılar">Yapılar</h2> - -<dl> - <dt>{{domxref("WebSocket.WebSocket", "WebSocket(url[, protocols])")}}</dt> - <dd>Yeni oluşturulmuş bir <code>WebSocket</code> objesi verir.</dd> -</dl> - -<h2 id="Sabitler">Sabitler</h2> - -<table class="standard-table"> - <tbody> - <tr> - <td class="header">Sabit</td> - <td class="header">Değer</td> - </tr> - <tr> - <td><code>WebSocket.CONNECTING</code></td> - <td><code>0</code></td> - </tr> - <tr> - <td><code>WebSocket.OPEN</code></td> - <td><code>1</code></td> - </tr> - <tr> - <td><code>WebSocket.CLOSING</code></td> - <td><code>2</code></td> - </tr> - <tr> - <td><code>WebSocket.CLOSED</code></td> - <td><code>3</code></td> - </tr> - </tbody> -</table> - -<h2 id="Özellikler">Özellikler</h2> - -<dl> - <dt>{{domxref("WebSocket.binaryType")}}</dt> - <dd>Bağlantıda kurulan ikilik veri tipi.</dd> - <dt>{{domxref("WebSocket.bufferedAmount")}} {{readonlyinline}}</dt> - <dd>Kuyruktaki değerlerin byte sayıları.</dd> - <dt>{{domxref("WebSocket.extensions")}} {{readonlyinline}}</dt> - <dd>Sunucu tarafından seçilmiş uzantılar.</dd> - <dt>{{domxref("WebSocket.onclose")}}</dt> - <dd>Bağlantı kapandığında çağırılan olay dinleyicisi.</dd> - <dt>{{domxref("WebSocket.onerror")}}</dt> - <dd>Hata oluştuğunda çağırılan olay dinleyicisi.</dd> - <dt>{{domxref("WebSocket.onmessage")}}</dt> - <dd>Sunucudan mesaj alındığında çağırılan olay dinleyicisi.</dd> - <dt>{{domxref("WebSocket.onopen")}}</dt> - <dd>Bağlantı kurulduğunda çağırılan olay dinleyicisi.</dd> - <dt>{{domxref("WebSocket.protocol")}} {{readonlyinline}}</dt> - <dd>Sunucu tarafından seçilmiş alt-protokol.</dd> - <dt>{{domxref("WebSocket.readyState")}} {{readonlyinline}}</dt> - <dd>Bağlantının şimdiki durumu.</dd> - <dt>{{domxref("WebSocket.url")}} {{readonlyinline}}</dt> - <dd>WebSocket'in mutlak URL'si.</dd> -</dl> - -<h2 id="Yöntemler">Yöntemler</h2> - -<dl> - <dt>{{domxref("WebSocket.close", "WebSocket.close([code[, reason]])")}}</dt> - <dd>Bağlantıyı kapatır.</dd> - <dt>{{domxref("WebSocket.send", "WebSocket.send(data)")}}</dt> - <dd>İletilmek üzere veriyi kuyruğa ekler.</dd> -</dl> - -<h2 id="Örnek">Örnek</h2> - -<p> </p> - -<pre class="brush: js">// WebSocket bağlantısı kur -const socket = new WebSocket('ws://localhost:8080'); - -// Bağlantı kurulduğunda -socket.addEventListener('open', function (event) { - socket.send('Sunucuya bağlanıldı.'); -}); - -// Mesaj alındığında -socket.addEventListener('message', function (event) { - console.log('Mesaj alındı: ', event.data); -}); - -// Mesaj gönder -socket.send('Merhaba!'); - -// Bağlantıyı bitir -socket.close(1000, 'Güle güle.');</pre> - -<p> </p> - -<h2 id="Belirtimler">Belirtimler</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th>Belirtim</th> - <th>Durum</th> - <th>Yorum</th> - </tr> - <tr> - <td>{{SpecName("HTML WHATWG", "web-sockets.html#the-websocket-interface", "WebSocket")}}</td> - <td>{{Spec2("HTML WHATWG")}}</td> - <td>İlk tanım</td> - </tr> - </tbody> -</table> - -<h2 id="Tarayıcı_desteği">Tarayıcı desteği</h2> - -<div> - - -<p>{{Compat("api.WebSocket")}}</p> -</div> - -<h2 id="Ayrıca_bakınız">Ayrıca bakınız</h2> - -<ul> - <li><a href="/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_client_applications">Writing WebSocket client applications <em>(en)</em></a></li> -</ul> |
