fr:code:data:tcpserver
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
fr:code:data:tcpserver [2012/03/23 09:49] – créée wismerheal | fr:code:data:tcpserver [2021/02/13 11:23] (Version actuelle) – modification externe 127.0.0.1 | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
====== TcpServer [En cours de Traduction Wismerheal][WSL] ====== | ====== TcpServer [En cours de Traduction Wismerheal][WSL] ====== | ||
- | This object allows you to create a TCP server, allowing you to listen to incoming connections. | + | Cet objet vous permet de créer un serveur |
- | ===== Functions | + | ===== Fonctions |
==== TcpServer ==== | ==== TcpServer ==== | ||
- | Constructor function. | + | Fonction de construction. |
- | === Syntax | + | === Syntaxe |
<code javascript> | <code javascript> | ||
var myObject = new TcpServer(events); | var myObject = new TcpServer(events); | ||
Ligne 13: | Ligne 13: | ||
=== Arguments === | === Arguments === | ||
- | - events - (object) | + | - events - (object) |
- | * onNewConnection - ([[# | + | * onNewConnection - ([[# |
=== Example === | === Example === | ||
Ligne 29: | Ligne 29: | ||
</ | </ | ||
- | ===== Methods | + | ===== Méthodes |
==== listen ==== | ==== listen ==== | ||
- | Start listening for clients. | + | Débute l' |
- | === Syntax | + | === Syntaxe |
<code javascript> | <code javascript> | ||
myObject.listen(address, | myObject.listen(address, | ||
Ligne 46: | Ligne 46: | ||
=== Arguments === | === Arguments === | ||
- | - address - (string) | + | - address - (string) |
- | - port - (integer) | + | - port - (integer) |
- | === Returns | + | === REnvoie |
- | * (TcpServer) | + | * (TcpServer) |
=== Exceptions === | === Exceptions === | ||
- | * (ListenError) | + | * (ListenError) |
==== waitForNewConnection ==== | ==== waitForNewConnection ==== | ||
- | Freezes the execution until a new connection arrives or **waitTime** | + | Gèle l' |
- | === Syntax | + | === Syntaxe |
<code javascript> | <code javascript> | ||
myObject.waitForNewConnection(waitTime); | myObject.waitForNewConnection(waitTime); | ||
Ligne 67: | Ligne 67: | ||
=== Arguments === | === Arguments === | ||
- | - waitTime - (integer) | + | - waitTime - (integer) |
=== Returns === | === Returns === | ||
- | * (TcpServer) | + | * (TcpServer) |
=== Exceptions === | === Exceptions === | ||
- | * (WaitForNewConnectionError) | + | * (WaitForNewConnectionError) |
==== nextPendingConnection ==== | ==== nextPendingConnection ==== | ||
- | Returns the next pending connection as a [[en: | + | Renvoie la prochaine connexion en attente comme un objet [[en: |
+ | Vous devrez stocker cet objet si vous voulez écrire sur ce "client" plus tard. | ||
- | === Syntax | + | === Syntaxe |
<code javascript> | <code javascript> | ||
myObject.nextPendingConnection(); | myObject.nextPendingConnection(); | ||
</ | </ | ||
- | === Returns | + | === Renvoie |
- | * (Tcp) the new client | + | * (Tcp) le nouveau |
=== Exceptions === | === Exceptions === | ||
- | * (NoPendingConnectionError) | + | * (NoPendingConnectionError) |
==== address ==== | ==== address ==== | ||
- | Returns the ip address on which this server is listening. | + | Renvoie l' |
- | === Syntax | + | === Syntaxe |
<code javascript> | <code javascript> | ||
myObject.address(); | myObject.address(); | ||
</ | </ | ||
- | === Returns | + | === Renvoie |
- | * (string) | + | * (string) |
==== port ==== | ==== port ==== | ||
- | Returns the port used by this server. | + | Renvoie le port utilisé par ce serveur. |
- | === Syntax | + | === Syntaxe |
<code javascript> | <code javascript> | ||
myObject.port(); | myObject.port(); | ||
</ | </ | ||
- | === Returns | + | === Renvoie |
- | * (integer) | + | * (integer) |
- | ===== Events | + | ===== Événements |
==== onNewConnection ==== | ==== onNewConnection ==== | ||
- | Called when a new client | + | Appelé quand un nouveau "client" s'est connecté. |
- | === Syntax | + | === Syntaxe |
<code javascript> | <code javascript> | ||
myObject.onNewConnection = function() {}; | myObject.onNewConnection = function() {}; |
fr/code/data/tcpserver.1332496156.txt.gz · Dernière modification : 2021/02/13 11:23 (modification externe)