W
Wayne M J
I am capturing syslogd traffic from a firewall/router, if I display the
results to Console it runs fine and dandy, but the minute I need it to go to
a ListBox, DataGrid or even a text box problems begin to arise.
It comes down to what looks like latency, but the control are not fast
enough to refresh in time to display all of the packet contents.
I have tried threading the function, but that only increases the latency.
At one point I seriously thought it was my code:
While True
Dim data(1024) As Byte
Dim recv As Integer
recv = s.ReceiveFrom(data, ep)
'iep = ep '*** Only needed to get the source of the traffic ***
Dim strData As String = System.Text.Encoding.ASCII.GetString(data, 0,
recv)
Console.WriteLine(strData)
End While
That is the business end of the code, and there is not much tweaking there
that can be done to speed up returns.
I have tried this code on a P4, a P3 and an old P2 with the same results,
the controls just did not refresh fast enough such that the next line of
traffic could be added.
I have compiled the code in both Debug (very bad latency about 2 messages in
3 were lost) and Release (1 in 2 to as low as 1 in 5 messages lost).
results to Console it runs fine and dandy, but the minute I need it to go to
a ListBox, DataGrid or even a text box problems begin to arise.
It comes down to what looks like latency, but the control are not fast
enough to refresh in time to display all of the packet contents.
I have tried threading the function, but that only increases the latency.
At one point I seriously thought it was my code:
While True
Dim data(1024) As Byte
Dim recv As Integer
recv = s.ReceiveFrom(data, ep)
'iep = ep '*** Only needed to get the source of the traffic ***
Dim strData As String = System.Text.Encoding.ASCII.GetString(data, 0,
recv)
Console.WriteLine(strData)
End While
That is the business end of the code, and there is not much tweaking there
that can be done to speed up returns.
I have tried this code on a P4, a P3 and an old P2 with the same results,
the controls just did not refresh fast enough such that the next line of
traffic could be added.
I have compiled the code in both Debug (very bad latency about 2 messages in
3 were lost) and Release (1 in 2 to as low as 1 in 5 messages lost).