I'm working on a small project that listen's to all the Known TCP & UDP Ports...And when It see's say a Port starting to be flooded by accessive packets it will close that port and Redirect to a New one....The whole idea is too keep the connection alive with a "Ping" until a New Port or Socket can be Established
This is some of the code for the DataTimerHandler, I want too setup Parameters for example: It will shut down a Port if it exceeds its Setup Limit by say 10 Packets ,so if you set it to allow 128 it goes too 138 Bam shuts port and opens a new one...
Now to do what i'm mentioning can i work that into this code below,I'm not sure where to start on making it do what i mentioned::
VB Code:
Private Sub DataTimerHandler(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mDataTimer.Tick If mState = eState.Connected Then Dim bytes() As Byte Dim length, readable As Integer readable = mSocket.Available If readable > 0 Then ReDim bytes(readable - 1) length = mSocket.Receive(bytes) RaiseEvent DataArrival(bytes, length) Else If mSocket.Poll(1, SelectMode.SelectRead) Then Me.Close() RaiseEvent Disconnected() End If End If End If End Sub


Reply With Quote