Torna al Thread

Function readData(ByRef objStream As NetworkStream, ByRef objTcpClient As TcpClient) As String Dim objStreamReader As New System.IO.StreamReader(objStream) 'streamreader per la lettura dei caratteri da un flusso di byte Dim sBuffer As String = Nothing objStream.ReadTimeout = 2000 Try sBuffer = objStreamReader.ReadToEnd 'write_Log("[iIntRead]: " + iIntRead.ToString + vbNewLine) Catch ex As IOException 'cattura dell'eccezione di tipo IOException 'write_Log("[Errore] : timeout scaduto" + vbNewLine) End Try objStreamReader.Dispose() ' rilascio delle risorse objStreamReader.Close() ' chiusura dello streamreader Return sBuffer End Function
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5