Aide:UDPRecv.txt
De Wiki AutoIt Français
Document original V3.3.6.1 :
###Function###
UDPRecv
###Description###
Receives data from a opened socket
###Syntax###
UDPRecv ( socketarray, maxlen [, flag] )
###Parameters###
@@ParamTable@@
socketarray
The socket/array as returned by a <a href="UDPBind.htm">UDPBind</a> function.
maxlen
max # of characters to receive.
flag
[optional] Forces the function to return binary data if set to 1 (default is 0, and will auto detect between binary/string).
Forces the function to return receive from IP/port if set to 2. Results are returned in an Array : [0] data, [1] from IP, [2] from Port.
If you want both just use 3.
@@End@@
###ReturnValue###
@@ReturnTable@@
Success: Returns binary/string sent by the opened socket or an array if flag = 2 or 3.
Failure: Returns "" and set @error.
@error: -1, -2 or -3 invalid socketarray.
windows API WSAGetError return value (see <a href="http://msdn.microsoft.com/en-us/library/ms740668.aspx">MSDN</a>).
@@End@@
###Remarks###
For backwards compatibility reasons this function will try to return strings by default. If null (0x00) characters are received then the return value will be a binary type.
To force the function to always return binary data (the most sensible option) then use the "flag" parameter set to 1.
###Related###
BinaryLen, BinaryMid, UDPBind, UDPOpen
###Example###
@@IncludeExample@@
Document traduit V3.3.6.1 :
###Function###
UDPRecv
###Description###
Reçoit des données d'une socket ouverte.
###Syntax###
UDPRecv ( socketarray, maxlen [, flag] )
###Parameters###
@@ParamTable@@
socketarray
La socket ou le tableau retourné par la fonction <a href="UDPBind.htm">UDPBind</a>.
maxlen
Nombre maximum de caractères à recevoir.
flag
[optionnel] Force la fonction à retourner des données binaire si le paramètre est à 1 (par défaut 0 et détectera automatiquement entre binaire et chaîne de caractère).
Force la fonction à retourner ce qui est reçu de l'IP ou du port si le paramètre est à 2. Les résultats sont retournés dans un tableau : [0] données, [1] de l'IP, [2] du port.
Si vous souhaitez les deux, mettez le paramètre à 3.
@@End@@
###ReturnValue###
@@ReturnTable@@
Succès: Retourne le binaire ou la chaîne de caractère envoyée par la socket ouverte ou un tableau si le paramètre est à 2 ou 3.
Échec: Retourne "" et fixe @error.
@error: -1, -2 ou -3 socket ou tableau invalide.
Valeur de retour de l'API Windows WSAGetError (Voir <a href="http://msdn.microsoft.com/en-us/library/ms740668.aspx">MSDN</a>).
@@End@@
###Remarks###
Pour des raisons de rétro-compatibilité, cette fonction essayera de retourner des chaînes de caractères par défaut. Si des caractères nul (0x00) sont reçus, alors la valeur retournée sera de type binaire.
Pour forcer la fonction à toujours retourner une donnée binaire (l'option la plus sensible) utilisez le paramètre "flag" à 1.
###Related###
<a href="BinaryLen.htm">BinaryLen</a>, <a href="BinaryMid.htm">BinaryMid</a>, <a href="UDPBind.htm">UDPBind</a>, <a href="UDPOpen .htm">UDPOpen </a>
###Example###
@@IncludeExample@@
Traducteur : Jerome
Contributeurs (pour les modifications avant le Wiki) : Tlem