Phreak Posted April 10, 2003 Posted April 10, 2003 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 didn't supply the correct syntax for logging on (potential hacker); is there a way to have the TCPListner or something, disconnect that specific connection? Quote If it works... don't worry, I'll fix it.
*Gurus* Derek Stone Posted April 10, 2003 *Gurus* Posted April 10, 2003 You call the Close method of the TcpClient object returned by TcpListener.AcceptTcpClient. Quote Posting Guidelines
Phreak Posted April 10, 2003 Author Posted April 10, 2003 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? Quote If it works... don't worry, I'll fix it.
*Gurus* Derek Stone Posted April 10, 2003 *Gurus* Posted April 10, 2003 [mshelp]ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemNetSocketsTcpListenerClassTopic.htm[/mshelp] Quote Posting Guidelines
Phreak Posted April 11, 2003 Author Posted April 11, 2003 Well, the TcpClient object that is returned is passed to a Client object from my Client class. 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 doesn't disconnect. Here is that code: Private Sub OnDisconnected(ByVal sender As Client) sender.Close() UpdateStatus("Disconnected") mcolClients.Remove(sender.ID) End Sub Any other ideas? Anyone? Quote If it works... don't worry, I'll fix it.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.