Join 34,000+ subscribers and receive articles from our
blog about software quality, testing, QA and security.

TCP-Connection: anybody listening?


#1

Hi,

after creating a TCP-Connection, is it possible to query whether there is a console actually listening? (Otherwise I’d like to change and log to file instead - or even better check in advance if there are any TCP-Listeners…)

Thanks

Michael


#2

Hello Michael,

You can use the Error event of the SmartInspect object to check if the SmartInspect library was able to connect to a Console or not. If this event is raised after a connection attempt failed (or later if the connection is interrupted somehow), you could use this event to re-configure the SmartInspect object to log to a file instead.

Checking for a Console before initiating a connection attempt is difficult, especially if the Console does not run locally but remotely. If the Console is running locally, you could check if the SmartInspectConsole.exe is running. For remote connections, however, there is currently no other way than checking if a connection can be established or not.

Hope that helps!