Created
June 16, 2014 12:11
-
-
Save normanmaurer/a227a6ce8101516290e1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Created by crised on 6/15/14. | |
| */ | |
| public class Handler extends ChannelInboundHandlerAdapter{ | |
| @Override | |
| public void channelActive(ChannelHandlerContext ctx) throws Exception { | |
| InetSocketAddress ipSocketAddress = new InetSocketAddress("255.255.255.255", 7686); | |
| ByteBuf byteBuf = Unpooled.copiedBuffer("QOTM?", CharsetUtil.UTF_8); | |
| DatagramPacket udpPacket = new DatagramPacket(byteBuf, ipSocketAddress); | |
| ChannelFuture future = ctx.writeAndFlush(udpPacket); | |
| System.out.println(future.isDone()); | |
| ctx.close(); | |
| System.out.println("bind method ended"); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment