Force Disconnect

Phreak

Well-known member
Joined
Jun 7, 2002
Messages
62
Location
Iowa, United States
Is it possible, if I have a TCPListener running, and it has multiple connections to it; to force disconnect one of the connections?
Example:

Billy, Jimmy, and Tommy all just connected to it (in that order), and Billy didnt supply the correct syntax for logging on (potential hacker); is there a way to have the TCPListner or something, disconnect that specific connection?
 
Now you lost me, call the Close method of the TCPClient on the server application that is created by the TCPListner.AcceptClient? Pardon my asking how I would do that? Or do you know of somewhere that goes over this topic?
 
Well, the TcpClient object that is returned is passed to a Client object from my Client class.

Code:
Dim x As New Client(mobjListener.AcceptTcpClient)

So I made the Client class inherit from TcpClient, and when my Disconnected event was raised (I raised it), the client object is passed to it, and I call the Close method, however it doesnt disconnect. Here is that code:

Code:
Private Sub OnDisconnected(ByVal sender As Client)
        sender.Close()
        UpdateStatus("Disconnected")
        mcolClients.Remove(sender.ID)
    End Sub

Any other ideas? Anyone?
 
Back
Top