473,409 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,409 software developers and data experts.

Connection Status with TCPClient

Hi...

I've written a small client, that uses the TCPClient for connecting to a
server and receives data from the server. When the connection is idle, after
5 minutes I get disconnected from the server. When this happens, I want to
reconnect to the server, but my problem is, I don't know how to find out if
I'm still connected or not.

Any ideas how to get that status?

Thanks
Patrick
Nov 15 '05 #1
1 5458
You need to subclass TcpClient class, and then call Socket.Connected
property to get the info.

"Patrick" <pa********@bluemail.ch> wrote in message
news:10***************@fuchs.cyberlink.ch...
Hi...

I've written a small client, that uses the TCPClient for connecting to a
server and receives data from the server. When the connection is idle, after 5 minutes I get disconnected from the server. When this happens, I want to
reconnect to the server, but my problem is, I don't know how to find out if I'm still connected or not.

Any ideas how to get that status?

Thanks
Patrick

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Mike Dole | last post by:
I'm working on a client - server application based on the 'How to Sockets Server and How to Sockets Client' code from the Visual Basic ..NET Resource Kit. Since I want to be able to send 'big...
0
by: Holger Steinestel | last post by:
Hello, I have a problem with the TCPClient class. After closing the connection with the Close() method, the connection on the Linux server remains open with the CLOSE_WAIT status. I found...
0
by: Adam Honek | last post by:
Hello, Lets assume I have an instance of TCPClient. I connect successfully and have the socket stream working. I when call the .close() method the TCPClient instance....so far so good. ...
8
by: Nikola Bucic | last post by:
Could someone tell me how can I constantly check if I'm connected to internet and if possible to determine what type of connection is it. My best shot wright now is to have a timer which will...
0
by: Arno | last post by:
Hi, I've written a class for client-socket connection, but I get a lot of times the error message "Unable to read data from the transport connection" when restart reading the stream with...
1
by: Terrance | last post by:
I'm trying to create a small messenger program that uses the tcpclient and tcplistenter objects. When I start the application and run the thread that fires the tcplistener; once the client sends...
6
by: Bjoern Schliessmann | last post by:
Hello, I'm currently trying to implement a simulation program with Kamaelia and need a reliable TCP connection to a data server. From Twisted, I know that a method is called if the connection...
0
by: id10t error | last post by:
Hello, I am trying to write soem code that will send data to an Oneil printer over our network. I know the printer works and is setup correctly because I can print to it from there software. In...
1
by: Peter Duniho | last post by:
On Wed, 06 Aug 2008 08:33:55 -0700, Markgoldin <markgoldin_2000@yahoo.com> wrote: Try to send something. Connection status can only be determined when you send data. If the connection is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.