Connect to UDP server

hezjing hezjing at gmail.com
Sun Mar 29 22:38:00 EDT 2009


Hi

I'm trying to use Netty 3.1.0 BETA1 and implement an UDP client:

        SocketAddress remoteAddress = new InetSocketAddress(remoteHost,
remotePort);
        SocketAddress localAddress = new InetSocketAddress(localPort);
        ChannelFactory factory = new
OioDatagramChannelFactory(Executors.newCachedThreadPool());
        ClientBootstrap bootstrap = new ClientBootstrap(factory);
        logger.info("Going to connect");
        ChannelFuture future = bootstrap.connect(remoteAddress,
localAddress);
        logger.info("Going to wait");
        future.await();


This is a very dummy client, hence there is no codec and handler.

When run, the program seems to be stuck at bootstrap.connect() forever ...
The "Going to connect" is printed but the "Going to wait" is not printed.


?


-- 

Hez
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/netty-users/attachments/20090330/4743beb0/attachment.html 


More information about the netty-users mailing list