Results 1 to 1 of 1

Thread: Help Please!!!!

  1. #1

    Thread Starter
    Hyperactive Member Rattlerr's Avatar
    Join Date
    Jul 2005
    Location
    FloralCity,Florida
    Posts
    269

    Question Help Please!!!!

    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:
    1. Private Sub DataTimerHandler(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mDataTimer.Tick
    2.             If mState = eState.Connected Then
    3.                 Dim bytes() As Byte
    4.                 Dim length, readable As Integer
    5.                 readable = mSocket.Available
    6.  
    7.                 If readable > 0 Then
    8.                     ReDim bytes(readable - 1)
    9.                     length = mSocket.Receive(bytes)
    10.                     RaiseEvent DataArrival(bytes, length)
    11.                 Else
    12.                     If mSocket.Poll(1, SelectMode.SelectRead) Then
    13.                         Me.Close()
    14.                         RaiseEvent Disconnected()
    15.                     End If
    16.                 End If
    17.             End If
    18.         End Sub
    Last edited by Rattlerr; Jan 1st, 2006 at 09:43 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width