I read a littlebit more some other code, where I found out how to do it.
Thanks anyway, I will post a UDP example soon. With some minor
changes in the echo server it works fine with UDP.



On Jul 22, 2006, at 11:22 PM, Joao wrote:
does anyone has a quick sample on how to use datagramConnector in a client
program?

not yet.. but what detail are you interested in?

 How to send datagrams once I do not really have to connect.
 I've got this from one of the samples. The handler sends the message
 in the sample below.

  // Set connect timeout.
       IoConnector connector = new SocketConnector();
( ( IoConnectorConfig ) connector.getDefaultConfig() ).setConnectTimeout( CONNECT_TIMEOUT );
             IoSession session;
       for( ;; )
       {
           try
           {
               ConnectFuture future = connector.connect(
                       new InetSocketAddress( HOSTNAME, PORT ),
new ClientSessionHandler( USE_CUSTOM_CODEC, values ) );
                             future.join();
               session = future.getSession();
               break;
           }


I am kinda messed up on where to write the code to send the udp datagram packet.
     Joao,
-pete


[EMAIL PROTECTED] - http://fotap.org/~osi






Reply via email to