[Cherbot-commit] SF.net SVN: cherbot: [86] trunk/src/net/sf/cherbot/AbstractConnection.java
Status: Alpha
Brought to you by:
christianhujer
|
From: <chr...@us...> - 2007-06-20 20:14:57
|
Revision: 86
http://svn.sourceforge.net/cherbot/?rev=86&view=rev
Author: christianhujer
Date: 2007-06-20 13:14:55 -0700 (Wed, 20 Jun 2007)
Log Message:
-----------
Added a method for querying whether the connection is established.
Modified Paths:
--------------
trunk/src/net/sf/cherbot/AbstractConnection.java
Modified: trunk/src/net/sf/cherbot/AbstractConnection.java
===================================================================
--- trunk/src/net/sf/cherbot/AbstractConnection.java 2007-06-20 20:14:11 UTC (rev 85)
+++ trunk/src/net/sf/cherbot/AbstractConnection.java 2007-06-20 20:14:55 UTC (rev 86)
@@ -98,6 +98,14 @@
}
}
+ /** Returns whether this connection is established.
+ * @return <code>true</code> if this connection is established, otherwise <code>false</code>.
+ * @see java.net.Socket#isConnected()
+ */
+ public boolean isConnected() {
+ return socket != null && socket.isConnected();
+ }
+
/** Sets the socket for the connection.
* Use this method if you want to create a connection on an existing socket instead of letting this Connection automatically create its own socket.
* @param socket Socket for the connection.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|