fr:code:data:tcp
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:tcp [2012/03/23 08:48] – créée wismerheal | fr:code:data:tcp [2021/02/13 11:23] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | ====== Tcp ====== | + | ====== Tcp [En cours de Traduction Wismerheal][WSL] |
| - | This object allows you to establish a connection to a TCP server. | + | Cet objet vous permet d' |
| - | ===== Functions | + | ===== Fonctions |
| ==== Tcp ==== | ==== Tcp ==== | ||
| - | Constructor function. | + | Fonction de construction. |
| - | === Syntax | + | === Syntaxe |
| <code javascript> | <code javascript> | ||
| var myObject = new Tcp(events); | var myObject = new Tcp(events); | ||
| Ligne 13: | Ligne 13: | ||
| === Arguments === | === Arguments === | ||
| - | - events - (object) | + | - events - (object) |
| - | * onConnected - ([[# | + | * onConnected - ([[# |
| - | * onDisconnected - ([[# | + | * onDisconnected - ([[# |
| - | * onReadyRead - ([[# | + | * onReadyRead - ([[# |
| - | * onBytesWritten - ([[# | + | * onBytesWritten - ([[# |
| - | * onError - ([[# | + | * onError - ([[# |
| === Example === | === Example === | ||
| Ligne 37: | Ligne 37: | ||
| </ | </ | ||
| - | ===== Methods | + | ===== Méthodes |
| ==== connect ==== | ==== connect ==== | ||
| - | Opens a connection to a server. | + | Ourvre une nouvelle connexion à un server. |
| - | === Syntax | + | === Syntaxe |
| <code javascript> | <code javascript> | ||
| myObject.connect(hostname, | myObject.connect(hostname, | ||
| Ligne 51: | Ligne 51: | ||
| === Arguments === | === Arguments === | ||
| - | - hostname - (string) | + | - hostname - (string) |
| - | - port - (integer) | + | - port - (integer) |
| - | - openMode - (OpenMode) | + | - openMode - (OpenMode) |
| - | === Returns | + | === Renvoie |
| - | * (Tcp) this Tcp | + | * (Tcp) ce Tcp |
| === 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 ==== | ||
| - | Writes some data to the server. | + | Écrit des données sur le serveur. |
| - | === Syntax | + | === Syntaxe |
| <code javascript> | <code javascript> | ||
| myObject.write(data); | myObject.write(data); | ||
| Ligne 71: | Ligne 71: | ||
| === Arguments === | === Arguments === | ||
| - | - data - (mixed) | + | - data - (mixed) |
| - | === Returns | + | === Renvoie |
| - | * (Tcp) this Tcp | + | * (Tcp) ce Tcp |
| === 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' |
| - | To known when the data has been sent use the [[# | + | Pour savoir quand la connexion est faite utilisez l' |
| ==== writeText ==== | ==== writeText ==== | ||
| - | Writes some text to the server. | + | Écrit du texte sur le serveur. |
| - | === Syntax | + | === Syntaxe |
| <code javascript> | <code javascript> | ||
| myObject.writeText(text); | myObject.writeText(text); | ||
| Ligne 89: | Ligne 89: | ||
| === Arguments === | === Arguments === | ||
| - | - text - (string) | + | - text - (string) |
| - | === Returns | + | === Renvoie |
| - | * (Tcp) this Tcp | + | * (Tcp) ce Tcp |
| === 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' |
| - | To known when the text has been sent use the [[# | + | Pour savoir quand la connexion est faite utilisez l' |
| ==== disconnect ==== | ==== disconnect ==== | ||
| - | Closes a connection with a server. | + | Ferme une connexion avec un serveur. |
| - | === Syntax | + | === Syntaxe |
| <code javascript> | <code javascript> | ||
| myObject.disconnect(); | myObject.disconnect(); | ||
| Ligne 109: | Ligne 109: | ||
| </ | </ | ||
| - | === Returns | + | === Renvoie |
| - | * (Tcp) this Tcp | + | * (Tcp) ce Tcp |
| === 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 quand la connexion est faite utilisez l' |
| ==== read ==== | ==== read ==== | ||
| - | Returns the data sent by the server. | + | Renvoie les données envoyées par le serveur. |
| - | === 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 une donnée est disponible utilisez l' |
| ==== readText ==== | ==== readText ==== | ||
| - | Returns the text sent by the server. | + | Renvoie le texte envoyé pr le serveur. |
| - | === Syntax | + | === Syntaxe |
| <code javascript> | <code javascript> | ||
| myObject.readText(encoding); | myObject.readText(encoding); | ||
| Ligne 142: | 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 une donnée 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 162: | Ligne 163: | ||
| === Arguments === | === Arguments === | ||
| - | - waitTime - (integer) | + | - waitTime - (integer) |
| - | === Returns | + | === Renvoie |
| - | * (Tcp) this Tcp | + | * (Tcp) ce Tcp |
| === Exceptions === | === Exceptions === | ||
| - | * (ConnectionError) | + | * (ConnectionError) |
| ==== waitForDisconnected ==== | ==== waitForDisconnected ==== | ||
| - | Freezes the execution until the connection has been closed or **waitTime** time elapsed. | + | Gèle l' |
| - | === Syntax | + | === Syntaxe |
| <code javascript> | <code javascript> | ||
| myObject.waitForDisconnected(waitTime); | myObject.waitForDisconnected(waitTime); | ||
| Ligne 182: | Ligne 183: | ||
| === Arguments === | === Arguments === | ||
| - | - waitTime - (integer) | + | - waitTime - (integer) |
| - | === Returns | + | === Renvoie |
| - | * (Tcp) this Tcp | + | * (Tcp) ce Tcp |
| === Exceptions === | === Exceptions === | ||
| - | * (DisconnectionError) | + | * (DisconnectionError) |
| ==== waitForReadyRead ==== | ==== waitForReadyRead ==== | ||
| - | Freezes the execution until data is available or **waitTime** time elapsed. | + | Gèle l' |
| - | === Syntax | + | === Syntaxe |
| <code javascript> | <code javascript> | ||
| myObject.waitForReadyRead(waitTime); | myObject.waitForReadyRead(waitTime); | ||
| Ligne 202: | Ligne 203: | ||
| === Arguments === | === Arguments === | ||
| - | - waitTime - (integer) | + | - waitTime - (integer) |
| === Returns === | === Returns === | ||
| - | * (Tcp) this Tcp | + | * (Tcp) ce Tcp |
| === Exceptions === | === Exceptions === | ||
| - | * (ReadyReadError) | + | * (ReadyReadError) |
| ==== waitForBytesWritten ==== | ==== waitForBytesWritten ==== | ||
| - | Freezes the execution until all data has been written or **waitTime** time elapsed. | + | Gèle l' |
| - | === Syntax | + | === Syntaxe |
| <code javascript> | <code javascript> | ||
| myObject.waitForBytesWritten(waitTime); | myObject.waitForBytesWritten(waitTime); | ||
| Ligne 222: | Ligne 223: | ||
| === Arguments === | === Arguments === | ||
| - | - waitTime - (integer) | + | - waitTime - (integer) |
| === Returns === | === Returns === | ||
| - | * (Tcp) this Tcp | + | * (Tcp) ce Tcp |
| === Exceptions === | === Exceptions === | ||
| - | * (BytesWrittenError) | + | * (BytesWrittenError) |
| - | ===== Events | + | ===== Évènements |
| ==== onConnected ==== | ==== onConnected ==== | ||
| - | Called when a connection is established. | + | Appelé quand la connexion est établie. |
| - | === Syntax | + | === Syntaxe |
| <code javascript> | <code javascript> | ||
| myObject.onConnected = function() {}; | myObject.onConnected = function() {}; | ||
| Ligne 249: | Ligne 250: | ||
| ==== onDisconnected ==== | ==== onDisconnected ==== | ||
| - | Called when a connection is closed. | + | Appelé quand la connexion est fermée. |
| - | === Syntax | + | === Syntaxe |
| <code javascript> | <code javascript> | ||
| myObject.onDisconnected = function() {}; | myObject.onDisconnected = function() {}; | ||
| Ligne 265: | Ligne 266: | ||
| ==== onReadyRead ==== | ==== onReadyRead ==== | ||
| - | Called when data is available and can be read using the [[# | + | Appelé quand ue donnée est disponible peut être lue en utilisant la méthode[[# |
| - | === Syntax | + | === Syntaxe |
| <code javascript> | <code javascript> | ||
| myObject.onReadyRead = function() {}; | myObject.onReadyRead = function() {}; | ||
| Ligne 281: | Ligne 282: | ||
| ==== onBytesWritten ==== | ==== onBytesWritten ==== | ||
| - | Called when data sent to the server has been written. | + | Appelé quand une donnée envoyée au serveur a été écrite. |
| - | === Syntax | + | === Syntaxe |
| <code javascript> | <code javascript> | ||
| myObject.onBytesWritten = function(bytes) {}; | myObject.onBytesWritten = function(bytes) {}; | ||
| Ligne 289: | Ligne 290: | ||
| === Arguments === | === Arguments === | ||
| - | - bytes - (integer) | + | - bytes - (integer) |
| === Example === | === Example === | ||
| Ligne 300: | Ligne 301: | ||
| ==== 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 308: | Ligne 309: | ||
| === Arguments === | === Arguments === | ||
| - | - errorMessage - (string) | + | - errorMessage - (string) |
| === Example === | === Example === | ||
| Ligne 321: | Ligne 322: | ||
| ==== OpenMode ==== | ==== OpenMode ==== | ||
| - | 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/tcp.1332492527.txt.gz · Dernière modification : (modification externe)
