Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.
Private _tcpClient As TcpClient Public Event NewSocketData(ByVal data As String) Private Sub DoRead(ByVal ar As IAsyncResult) Dim bytesRead As Integer Dim message As String Try '// Finish asynchronous read into readBuffer and return number of bytes read. bytesRead = Me._tcpClient.GetStream.EndRead(ar) If bytesRead < 1 Then ' If no bytes were read server has closed. Me._socketdata.Add("Connection was terminated") RaiseEvent NewSocketData("Connection was terminated") Exit Sub End If '// Convert the byte array the message was saved into, minus two for the '// Chr(13) and Chr(10) message = Encoding.ASCII.GetString(Me._readBuffer, 0, bytesRead - 2) ProcessCommands(message) Catch ex As Exception MessageBox.Show(ex.StackTrace.ToString) End Try 'Need help here.. this does not work RaiseEvent NewSocketData("test") '// Start a new asynchronous read into readBuffer. Me._tcpClient.GetStream.BeginRead(Me._readBuffer, 0, READ_BUFFER_SIZE, AddressOf DoRead, Nothing) End Sub
|C# - SOLID Question||6||35|
|Debug Windows Service program in C#||4||24|
|Help with deleting records in File2 when no matching records in both File1 and File2||4||32|
|C# Winform Button, make the border thicker and different color?||5||28|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
18 Experts available now in Live!