narfight
Messages postés129Date d'inscriptionlundi 17 mars 2003StatutMembreDernière intervention 4 mars 2010 25 févr. 2008 à 15:07
voici la réponse à la MSDN adapté à mon cas :
<hr size="2" width="100%" /> 'on regarde si il est toujours connecté
Try
Dim tmp(0) As Byte
Dim blockingState As Boolean = LesClients(who).Socket.Blocking
LesClients(who).Socket.Blocking = False
LesClients(who).Socket.Send(tmp, 0, 0)
LesClients(who).Socket.Blocking = blockingState
Catch e As SocketException
If Not e.NativeErrorCode.Equals(10035) Then
ListBox.Invoke(dlgDisplay, LesClients(who).Name + " est déconnecté")
LesClients.RemoveAt(who)
Exit For
End If
End Try
<hr size="2" width="100%" />
Ca marche mais c'est loin d'etre simple quand même.