TcpClient error : cannot obtain value
Bonjour,
Je dois recevoir des trames de façon continue. Code VB .NET 2005
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
Private Sub TraitRecept()
Try
TcpRecept.Connect(DistantAdresse, IntPort)
Catch ex As Exception
End Try
Try
While TcpRecept.GetStream.CanRead
If Not TcpRecept.Connected Then Exit While
SyncLock TcpRecept.GetStream
Dim UserStream As New Class_ClientTcp(TcpRecept)
UserStream.EnregStream()
UserStream = Nothing
End SyncLock
End While
Catch exOverFlow As StackOverflowException
Catch exArgument As ArgumentNullException
Catch exSocket As Sockets.SocketException
Catch ex As Exception
End Try
Try
TcpRecept.Close()
Catch ex As Exception
End Try
Thread.Sleep(1000)
TraitRecept()
End Sub |
La réception se fait normalement en cours de journée mais la nuit à la même période, le service s'arrête en indiquant une erreur : "error : cannot obtain value". Comment puis-je traiter l'érreur ?
Merci d'avance.