A small error in the documentation
03data
03data at live.nl
Mon Jul 18 16:50:23 EDT 2011
[quote]Also, please don't hesitate to contact the Netty project community and
let us know if there's any incorrect information, errors in grammar and
typo, and if you have a good idea to improve the documentation.[/quote]
@Override
public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e)
{
UnixTime time = new UnixTime(System.currentTimeMillis() / 1000);
ChannelFuture f = e.getChannel().write(time);
f.addListener(ChannelFutureListener.CLOSE);
}
package org.jboss.netty.example.time;
import java.util.Date;
public class UnixTime {
private final int value;
public UnixTime(int value) {
this.value = value;
}
public int getValue() {
return value;
}
@Override
public String toString() {
return new Date(value * 1000L).toString();
}
}
The constructor has an int as an argument, so System.currentTimeMillis() /
1000 should be casted to an int.
--
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/A-small-error-in-the-documentation-tp6596358p6596358.html
Sent from the Netty User Group mailing list archive at Nabble.com.
More information about the netty-users
mailing list