User guide for 3.x

Aelbery.Lee edited this page Mar 30, 2018 · 4 revisions

This page needs work!

Please read this until the user guide is moved to the wiki.

There is a bug in section 1.6 Writing a Time Client, the TimeClientHandler.java should transfer received signed int to "unsigned int".

@Override public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) { ChannelBuffer buf = (ChannelBuffer) e.getMessage(); long currentTimeMillis = buf.readInt(); currentTimeMillis = currentTimeMillis >= 0 ? currentTimeMillis : currentTimeMillis & 0x0FFFFFFFFL; currentTimeMillis = (currentTimeMillis - 2208988800L) * 1000L; System.out.println(new Date(currentTimeMillis)); e.getChannel().close(); }

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.