TCPSocket.WriteData

Bojour
Il me semble que 3 commandes de TCPSocket ne fonctionnent pas:

It seems to me that 3 TCPSocket commands are not working:

Poll + WriteData + close

Exemple de la documentation:

Var socket1 As New TCPSocket

socket1.Address = "server.domain.com"
socket1.Port = 80

// connect the socket
socket1.Connect

// while the socket isn't connected
While Not socket1.IsConnected
  // poll the socket to let it do its thing
  socket1.Poll
  // if an error occurs, the Error event will fire
Wend

// if we broke the loop because we're connected
If socket1.IsConnected Then
  // here would be a great place to do a synchronous read operation...
  socket1.WriteData ( "aa" )
  // if an error occurs, the Error event will fire
End If

// close the socket
socket1.Close

//

Is this done in a thread?

You haven’t told us why you think this is not working.

What does your error event do?

If an error occurs at connect, your first loop will loop for ever.

Merci pour la réponse, j’utilise maintenant la version 2021 Release 3,1 (depuis hier) et je n’ai plus le problème.

Thank you for your reply
Now I am using XOJO 2021 Release 3.1 and I no longer have a problem
Have a good day

S’il vous plaît ne faites pas une boucle comme ça. Utilisez des événements.

Please don’t do a loop like this. Please use events.

ok, thank
Now I use event