Sorry if I am not following the forums rules by any of this, my first post so..
I have been working on a little tcp client/server project and I am stuck with a problem after searching for hours and I have read a lot of threads here on vbforums without finding what Im looking for..

My client and server communicate just fine, the problem I have is this:
The server program user interface allowes one to enter the port number you want the server to listen on. The server program attempts to opens any port that I set, and always goes on to the next step, i.e. gives feedback that it is now listening. This also happens when I attempt to listen on ports that I know for a fact are in use by other application. The code does not give any error when port is already in use by other applications, it goes right on to say "listening for connections".. For instance, I have an irc-server running on 6666, so when I set port 6666 in the listen program, It doesnt give an error, it just pretends everything is fine and says "listening".. If I try to connect, the connection of course goes through to the irc-server because it is using that specific port.

I will try to paste my code here:
Code:
              Try
                servidor = New TcpListener(ip, thePort)
                servidor.Start() ''initializing port listener
            Catch ex As SocketException
      conversacion.Text &= "[" & TimeOfDay & "] " & "ERROR binding port :" & thePort & vbCrLf
                Exit Sub
            End Try
I am using try->catch and It does not give any message. So "conversacion" is a text field, where I want the error binding port-message to come, any transfers between the client and server is showing there so I know there is nothing wrong with that. The error DOES show If I am running two instances of the same server program, and one is already using the designated port. I want it to be able to give this error message if another program is using the chosen port.

Any help?