Login  
Search All Forums
Dart Home | PowerTCP Sockets for .NET | Custom Development Reply | PowerTCP Sockets for .NET (Secure and Standard) Topics | Forums   
AuthorForum: PowerTCP Sockets for .NET (Secure and Standard)
Topic: Check for Alive/Dead and process
Daxel

From: Framingham, MA USA
Posts: 2
Member Since: 01/04/08
posted January 4, 2008 12:09 PM

I am trying to check to see if a server service is alive by connecting to a service on a specific port (11111 - randomly picked). I don't need to send any data, just connect, then disconnect.
It works nicely IF all of the server services are up, but if I have a garbled host, or it does not respond, everything falls out of sync. I am checking 20 different servers (and their services), at a rate of 1 every five seconds.

Here is what I get in my debug:
Check #1
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
end connect:The requested name is valid, but no data of the requested type was found
Check #2
The thread '<No Name>' (0x1be4) has exited with code 0 (0x0).
Check #3
Completed

The second check is completely bypassed because the thread is still hanging out there. If I get a bad request, how can I get rid of it faster?

    Try
      Tcp1.BeginConnect(host, port)
      If Tcp1.Connected = True Then
 debug.writeline("Completed")
      End If

      If Tcp1.Connected = True Then Tcp1.Close()
      'Tcp1.Close()
    Catch ex As Exception
      Debug.WriteLine("dart:" & ex.Message.ToString())

    End Try

the rest are the basics from your tcp example.
Arjun

From: Rome, NY, USA
Posts: 137
Member Since: 09/17/07
posted January 7, 2008 9:44 AM

Hello Dain,

I have gone through the code and the problem seems to me is that you are using an asynchronous method, but programming in a synchronous manner.
Therefore I would suggest you to use either the asynchronous or the synchronous method to achieve the desired functionality.

I hope this helps.
Have a great day.

Regards,
Arjun

------
-Non-current subscribers must contact sales@dart.com to update subscription and receive continued support as needed.
------

Daxel

From: Framingham, MA USA
Posts: 2
Member Since: 01/04/08
posted January 8, 2008 2:32 PM

Ok, I tried running it synchonous method:
Check #1
A first chance exception of type 'Dart.PowerTCP.Sockets.BusyException' occurred in Dart.PowerTCP.Sockets.dll
dart:Operation in progress.
Check #2
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in Dart.PowerTCP.Sockets.dll
10060
Check #4
The thread 0x4b0 has exited with code 0 (0x0).
The program '[952] TermServ.vshost.exe: Managed' has exited with code 0 (0x0).

Note, it never did check #3.
Jamie Powell (Admin)

From: Rome, NY USA
Posts: 448
Member Since: 03/13/07

Extra Support Options
Custom Application Development

posted January 8, 2008 4:12 PM

Hello, this request needs to be handled through our administrative procedures prior to response. Please contact sales@dart.com directly about this issue.
Reply | PowerTCP Sockets for .NET (Secure and Standard) Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX