|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
TCP Client detects TCP Server?I want my TCP client to be able to to tell if there is a TCP Server running
at the specified IP address and port number without creating exceptions, because this code will be put in an infinite loop that will keep checking to detect when the Server is up. How can I do that? I wrote TCP client and TCP server applications using TCPClient and TCPListner objects. Currently at the Client side, I create a NetworkStream and use the GetStream to establish a communication channel between the client and the server. The problem with this approach is that the client will hang on until a connection is found or until it times out. =?Utf-8?B?QW1qYWQ=?= <Am***@discussions.microsoft.com> wrote in
news:D2099DB0-8166-4835-87A2-3F38C8C802C2@microsoft.com: You should open the connection in it's own thread... or via async calls.> Currently at the Client side, I create a NetworkStream and use the > GetStream to establish a communication channel between the client and > the server. The problem with this approach is that the client will > hang on until a connection is found or until it times out. > > This will allow your GUI to continue without hanging. I never mentioned a GUI interface. In fact I don't have one, since I'm using
Windows Services. I was hoping to get something similar to pinging the Server and return a True or False to determine if the server was up or not, instead of making exceptions in my loop! Show quoteHide quote "Spam Catcher" wrote: > =?Utf-8?B?QW1qYWQ=?= <Am***@discussions.microsoft.com> wrote in > news:D2099DB0-8166-4835-87A2-3F38C8C802C2@microsoft.com: > > > Currently at the Client side, I create a NetworkStream and use the > > GetStream to establish a communication channel between the client and > > the server. The problem with this approach is that the client will > > hang on until a connection is found or until it times out. > > > > > > You should open the connection in it's own thread... or via async calls. > > This will allow your GUI to continue without hanging. > =?Utf-8?B?QW1qYWQ=?= <Am***@discussions.microsoft.com> wrote in
news:4CB9904D-5441-4A54-B6CD-28C906DC4C7A@microsoft.com: I don't think the built in TCP classes support this feature.> I never mentioned a GUI interface. In fact I don't have one, since I'm > using Windows Services. I was hoping to get something similar to > pinging the Server and return a True or False to determine if the > server was up or not, instead of making exceptions in my loop!
VB.NET events creates a hidden delegate, but how do I access it?
Console app no accessible 'Main' method with an app... CurrencyManager Question How to use the httpwebrequest with Cookies in "GET" method Overnight processes why are there still COM controls in VS.Net 2005? datagridview cell - get row/column info for updating data- how? Convert VBScript to Visual Basic .Net LockWindowUpdate VB 2005 Converting IP Address as string to MyIP as IPAddress |
|||||||||||||||||||||||