I am using this:
IoSession s = con.getIoSession();
if(s.isConnected() && con.alive) {
s.write(msg);
}
Also my app sends Pings every 2 minutes, and I've set the idle timer to 2
minutes in sessionOpened, using session.setIdleTime, and use the idle
notification as an indicator something is wrong with that IoSession.
# -----Original Message-----
# From: Uday Prakash (DHL CZ) [mailto:[EMAIL PROTECTED]
# Sent: Tuesday, April 24, 2007 1:15 AM
# To: [email protected]
# Subject: Checking if connectionb is alive.
#
# Hi,
#
# I was looking thru some documentation online and realized
# that there is no standard way [well, at least I didn't find
# any, may be I didn't look hard enough or in the right place]
# to check if a tcp/ip connection is alive between the server
# and client.
#
# The reason I am posting is, to figure out if there is a clean
# way, from the out side or inside the server to check if the
# connection is alive between the server and client. This is so
# that I can have an indicator on the gui representing the
# status of the connection.
#
# Could anyone please direct me on this?
#
# BTW: The Server I built on MINA performed beyond
# expectations, it was needed to have a turnaround time of 70ms
# for message processing and reply, I was able to get it done in 15ms!!!
#
# Thank You,
#
# -Uday