An established connection was aborted!

daj_uk

New member
Joined
Jul 4, 2007
Messages
2
Location
Glasgow, UK
Programming Experience
3-5
Hi All,

I've got a really simple/stupid question I'm sure!

I've never really done anything in Vb.NET and sockets so this is my first attempt. Anyway, I want to pull together a simple app that will check a number of ports on a remote machine. Let's say my app will check that port 80, 25 and others are available. So if 25 does not respond I can make a fair assessment that there may be a problem with the SMTP server!

So, the code I thought would be simple....

VB.NET:
[FONT="Courier New"]        Dim tcpClient As New System.Net.Sockets.TcpClient()
        tcpClient.Connect(<the ip address>, <the port>)[/FONT]
However, using the same ip address I can test port 80 and all is well. If I test port 25 I get an error "A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll" and a popup window tell me that "An established connection was aborted by the software in your host machine" on the tcpClient.Connect line

What am I missing here? Is this the wrong way to do it?


Thanks

David
 
Last edited:
Back
Top