Hi

I am trying to build a program to listen to different ports that the users specify's, but I also have 2 option buttons 1 that is for accepting any connection attempts on the listening ports, and one for rejecting any connection attempts. It works fine, except it only rejects them it will not accept the connection attempts for some reason here is my winsock connection request code

Private Sub Winsock1_ConnectionRequest(Index As Integer, ByVal requestID As Long)

If Index = 0 Then
If Option2.Value = True Then
intMax = intMax + 1
Load Winsock1(intMax)
Winsock1(intMax).LocalPort = Winsock1(Index).LocalPort
Winsock1(intMax).Close
Else
If Option1.Value = True Then
intMax = intMax + 1
Load Winsock1(intMax)
Winsock1(intMax).LocalPort = Winsock1(Index).LocalPort
Winsock1(intMax).Accept requestID
End If
End If
End If
End Sub


what's wrong with my code? why isn't it letting them connect?

also is there anyway to find out which winsock1's index is listening on which port. because I want the user to be able to remove a port as well.