fr:code:data:udp
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:udp [2012/03/23 10:12] – créée wismerheal | fr:code:data:udp [2021/02/13 11:23] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| ====== Udp [En cours de Traduction Wismerheal][WSL] ====== | ====== Udp [En cours de Traduction Wismerheal][WSL] ====== | ||
| - | This object allows you to establish a connection to an UDP peer. | + | cet objet vous permet d' |
| - | ===== Functions | + | ===== Fonctions |
| ==== Udp ==== | ==== Udp ==== | ||
| - | Constructor function. | + | Fonction de construction. |
| - | === Syntax | + | === Syntaxe |
| <code javascript> | <code javascript> | ||
| var myObject = new Udp(events); | var myObject = new Udp(events); | ||
| Ligne 13: | Ligne 13: | ||
| === Arguments === | === Arguments === | ||
| - | - events - (object) | + | - events - (object) |
| - | * onConnected - ([[# | + | * onConnected - ([[# |
| - | * onDisconnected - ([[# | + | * onDisconnected - ([[# |
| - | * onReadyRead - ([[# | + | * onReadyRead - ([[# |
| - | * onError - ([[# | + | * onBytesWritten - ([[# |
| + | * onError - ([[# | ||
| === Example === | === Example === | ||
| Ligne 36: | Ligne 37: | ||
| </ | </ | ||
| - | ===== Methods | + | ===== Méthodes |
| ==== connect ==== | ==== connect ==== | ||
| - | Opens a connection to a peer. | + | Ouvre une connexion à un " |
| - | === Syntax | + | === Syntaxe |
| <code javascript> | <code javascript> | ||
| myObject.connect(hostname, | myObject.connect(hostname, | ||
| Ligne 50: | Ligne 51: | ||
| === Arguments === | === Arguments === | ||
| - | - hostname - (string) | + | - hostname - (string) |
| - | - port - (integer) | + | - port - (integer) |
| - | - openMode - (OpenMode) | + | - openMode - (OpenMode) |
| - | === Returns | + | === REnvoie=== |
| - | * (Udp) this Udp | + | * (Udp) cet Udp |
| === Notes === | === Notes === | ||
| - | This method is asynchronous, this means that it will return before a connection is established. | + | Cette méthode est asynchrone, cela signifie que le renvoi s' |
| - | To known when a connection is made use the [[# | + | Pour savoir quand la connexion est faite utilisez l' |
| ==== write ==== | ==== write ==== | ||
| + | Écritdes données sur le " | ||
| Writes some data to the peer. | Writes some data to the peer. | ||
| - | === Syntax | + | === Syntaxe |
| <code javascript> | <code javascript> | ||
| myObject.write(data); | myObject.write(data); | ||
| Ligne 70: | Ligne 72: | ||
| === Arguments === | === Arguments === | ||
| - | - data - (mixed) | + | - data - (mixed) |
| - | === Returns | + | === Renvoie |
| - | * (Udp) this Udp | + | * (Udp) cet Udp |
| === Notes === | === Notes === | ||
| - | This method is asynchronous, this means that it will return before the data has been written. | + | Cette méthode est asynchrone, cela signifie que le renvoi s' |
| - | Due to the unreliable | + | A cause de la nature |
| ==== writeText ==== | ==== writeText ==== | ||
| - | Writes some text to the peer. | + | Écrit du texte sur le " |
| - | === Syntax | + | === Syntaxe |
| <code javascript> | <code javascript> | ||
| myObject.writeText(text); | myObject.writeText(text); | ||
| Ligne 90: | Ligne 92: | ||
| - text - (string) the text to write | - text - (string) the text to write | ||
| - | === Returns | + | === REnvoie |
| - | * (Udp) this Udp | + | * (Udp) cet Udp |
| === Notes === | === Notes === | ||
| - | This method is asynchronous, this means that it will return before the data has been written. | + | Cette méthode est asynchrone, cela signifie que le renvoi s' |
| - | Due to the unreliable | + | A cause de la nature |
| ==== disconnect ==== | ==== disconnect ==== | ||
| - | Closes a connection with a peer. | + | Ferme la connexion avec le " |
| - | === Syntax | + | === Syntaxe |
| <code javascript> | <code javascript> | ||
| myObject.disconnect(); | myObject.disconnect(); | ||
| Ligne 108: | Ligne 110: | ||
| </ | </ | ||
| - | === Returns | + | === REnvoie |
| - | * (Udp) this Udp | + | * (Udp) ce Udp |
| === Notes === | === Notes === | ||
| - | This method is asynchronous, this means that it will return before the connection is closed. | + | Cette méthode est asynchrone, cela signifie que le renvoi s' |
| - | To known when the connection is closed use the [[# | + | Pour savoir si une connexion est fermée utilisez l' |
| ==== read ==== | ==== read ==== | ||
| - | Returns the data sent by the peer. | + | Renvoie les données envoyées par le " |
| - | === Syntax | + | === Syntaxe |
| <code javascript> | <code javascript> | ||
| myObject.read(); | myObject.read(); | ||
| </ | </ | ||
| - | === Returns | + | === Renvoie |
| - | * (mixed) | + | * (mixed) |
| === Notes === | === Notes === | ||
| - | To known when data is available use the [[# | + | Pour savoir quand les données sont disponibles utilisez l' |
| ==== readText ==== | ==== readText ==== | ||
| - | Returns the text sent by the peer. | + | Renvoie le texte envoyé au " |
| - | === Syntax | + | === Syntaxe |
| <code javascript> | <code javascript> | ||
| myObject.readText(encoding); | myObject.readText(encoding); | ||
| Ligne 141: | Ligne 143: | ||
| === Arguments === | === Arguments === | ||
| - | - encoding - ([[en: | + | - encoding - ([[en: |
| - | === Returns | + | === Renvoie |
| - | * (string) | + | * (string) |
| === Notes === | === Notes === | ||
| - | To known when text is available use the [[# | + | Pour savoir quand le texte est disponible utilisez l' |
| ==== waitForConnected ==== | ==== waitForConnected ==== | ||
| - | Freezes the execution until a connection has been established or **waitTime** | + | Gèle l' |
| - | === Syntax | + | === Syntaxe |
| <code javascript> | <code javascript> | ||
| myObject.waitForConnected(waitTime); | myObject.waitForConnected(waitTime); | ||
| Ligne 161: | Ligne 163: | ||
| === Arguments === | === Arguments === | ||
| - | - waitTime - (integer) | + | - waitTime - (integer) |
| === Returns === | === Returns === | ||
| - | * (Udp) this Udp | + | * (Udp) cet Udp |
| === Exceptions === | === Exceptions === | ||
| - | * (ConnectionError) | + | * (ConnectionError) |
| ==== waitForDisconnected ==== | ==== waitForDisconnected ==== | ||
| - | Freezes the execution until the connection has been closed or **waitTime** | + | Gèle l' |
| - | === Syntax | + | === Syntaxe |
| <code javascript> | <code javascript> | ||
| myObject.waitForDisconnected(waitTime); | myObject.waitForDisconnected(waitTime); | ||
| Ligne 181: | Ligne 183: | ||
| === Arguments === | === Arguments === | ||
| - | - waitTime - (integer) | + | - waitTime - (integer) |
| - | === Returns | + | === Renvoie |
| - | * (Udp) this Udp | + | * (Udp) cet Udp |
| === Exceptions === | === Exceptions === | ||
| - | * (DisconnectionError) | + | * (DisconnectionError) |
| ==== waitForReadyRead ==== | ==== waitForReadyRead ==== | ||
| - | Freezes the execution until data is available or **waitTime** | + | Gèle l' |
| - | === Syntax | + | === Syntaxe |
| <code javascript> | <code javascript> | ||
| myObject.waitForReadyRead(waitTime); | myObject.waitForReadyRead(waitTime); | ||
| Ligne 201: | Ligne 203: | ||
| === Arguments === | === Arguments === | ||
| - | - waitTime - (integer) | + | - waitTime - (integer) |
| - | === Returns | + | === Renvoie |
| - | * (Udp) this Udp | + | * (Udp) cet Udp |
| === Exceptions === | === Exceptions === | ||
| - | * (ReadyReadError) | + | * (ReadyReadError) |
| - | ===== Events | + | ===== Évènements |
| ==== onConnected ==== | ==== onConnected ==== | ||
| - | Called when a connection is established. | + | Appellé quand une connexion est établie. |
| - | === Syntax | + | === Syntaxe |
| <code javascript> | <code javascript> | ||
| myObject.onConnected = function() {}; | myObject.onConnected = function() {}; | ||
| Ligne 228: | Ligne 230: | ||
| ==== onDisconnected ==== | ==== onDisconnected ==== | ||
| - | Called when a connection is closed. | + | Appelé quand une connexion est fermée. |
| - | === Syntax | + | === Syntaxe |
| <code javascript> | <code javascript> | ||
| myObject.onDisconnected = function() {}; | myObject.onDisconnected = function() {}; | ||
| Ligne 244: | Ligne 246: | ||
| ==== onReadyRead ==== | ==== onReadyRead ==== | ||
| - | Called when data is available and can be read using the [[# | + | Appelé quand les données sont disponibles et peuvent être lues pas la méthode |
| - | === Syntax | + | === Syntaxe |
| <code javascript> | <code javascript> | ||
| myObject.onReadyRead = function() {}; | myObject.onReadyRead = function() {}; | ||
| Ligne 260: | Ligne 262: | ||
| ==== onError ==== | ==== onError ==== | ||
| - | Called when an error has occurred. | + | Appelé quand une erreur survient. |
| - | === Syntax | + | === Syntaxe |
| <code javascript> | <code javascript> | ||
| myObject.onError = function(errorMessage) {}; | myObject.onError = function(errorMessage) {}; | ||
| Ligne 268: | Ligne 270: | ||
| === Arguments === | === Arguments === | ||
| - | - errorMessage - (string) | + | - errorMessage - (string) |
| === Example === | === Example === | ||
| Ligne 281: | Ligne 283: | ||
| ==== OpenMode ==== | ==== OpenMode ==== | ||
| - | Udp open mode. | + | Mode d' |
| - | === Values | + | === Valeurs |
| - | - ReadOnly: | + | - ReadOnly: |
| - | - WriteOnly: | + | - WriteOnly: |
| - | - ReadWrite: | + | - ReadWrite: |
| - | - Unbuffered: | + | - Unbuffered: |
| === Notes === | === Notes === | ||
| - | This is a flag enumeration, | + | Ce sont des indicateurs ce qui veut dire que vous pouvez utiliser de multiples valeurs en utilisant l' |
| Example: | Example: | ||
| <code javascript> | <code javascript> | ||
| myObject.connect(" | myObject.connect(" | ||
| </ | </ | ||
fr/code/data/udp.1332497542.txt.gz · Dernière modification : (modification externe)
