Ok I recently decided to write a firewall from scratch to give myself a better understanding of computer security at a basic level, I am programming in Visual Basic and i decided to start off with a basic forwarding method whereby all connections to computer come to program first if they are not on disallow list then it will forward it to the appopriate application on the apporpriate port! I used a winsock control on an index to listen for the connections but i get the error message "Address in use!" here is the code:

Code:
Private Sub cmdStart_Click()
    For i = 1 To 49151
        Load wsListen(i)
        wsListen(i).LocalPort = i
        wsListen(i).Listen
    Next i
End Sub
any suggestions would be very helpfull!

-Aldur