I've got this, well, rather major problem. My application's memory usage keeps incrementing at a rate of about 4 kb/sec.
I've got a TcpListener, and I've got a timer that checks whether there are any pending connections on the TcpListener. Like this;
Well, I narrowed it down (by commenting out things) to the 'If TcpL.Pending Then' line, and found out that's the source of my memory problems. Now, I was wondering, how can I avoid the TcpListener from leaking memory like this? It's a major problem to my application.
I've got a TcpListener, and I've got a timer that checks whether there are any pending connections on the TcpListener. Like this;
VB.NET:
Private Sub Listen_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Listen.Tick
' If there is a connection pending, accept it
If TcpL.Pending Then
AcceptClient()
End If
End Sub
Well, I narrowed it down (by commenting out things) to the 'If TcpL.Pending Then' line, and found out that's the source of my memory problems. Now, I was wondering, how can I avoid the TcpListener from leaking memory like this? It's a major problem to my application.