[jetrix-cvs] SF.net SVN: jetrix:[721] jetrix/trunk/src/java/net/jetrix
Brought to you by:
smanux
From: <sm...@us...> - 2008-08-07 21:01:06
|
Revision: 721 http://jetrix.svn.sourceforge.net/jetrix/?rev=721&view=rev Author: smanux Date: 2008-08-07 21:01:02 +0000 (Thu, 07 Aug 2008) Log Message: ----------- Changed the ping to compute the round trip time Modified Paths: -------------- jetrix/trunk/src/java/net/jetrix/agent/QueryAgent.java jetrix/trunk/src/java/net/jetrix/filter/PingFilter.java Modified: jetrix/trunk/src/java/net/jetrix/agent/QueryAgent.java =================================================================== --- jetrix/trunk/src/java/net/jetrix/agent/QueryAgent.java 2008-08-07 09:15:16 UTC (rev 720) +++ jetrix/trunk/src/java/net/jetrix/agent/QueryAgent.java 2008-08-07 21:01:02 UTC (rev 721) @@ -215,13 +215,13 @@ } /** - * Return the ping time to the server in milliseconds. + * Return the round trip time to the server in milliseconds. */ - public long getPing() throws IOException + public int getPing() throws IOException { long time = System.currentTimeMillis(); getVersion(); - return (System.currentTimeMillis() - time) / 2; + return (int) (System.currentTimeMillis() - time); } } Modified: jetrix/trunk/src/java/net/jetrix/filter/PingFilter.java =================================================================== --- jetrix/trunk/src/java/net/jetrix/filter/PingFilter.java 2008-08-07 09:15:16 UTC (rev 720) +++ jetrix/trunk/src/java/net/jetrix/filter/PingFilter.java 2008-08-07 21:01:02 UTC (rev 721) @@ -44,7 +44,7 @@ if ("true".equals((user.getProperty("command.ping")))) { - long delay = (System.currentTimeMillis() - ((Long) user.getProperty("command.ping.time")).longValue()) >> 1; + long delay = (System.currentTimeMillis() - ((Long) user.getProperty("command.ping.time")).longValue()); client.send(new PlineMessage("command.ping.message", delay)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |