Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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?

If it works... don't worry, I'll fix it.
Posted
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?
If it works... don't worry, I'll fix it.
Posted

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?

If it works... don't worry, I'll fix it.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...