mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joao <j...@wireless-networks.com>
Subject Re: DatagramConnector client sample
Date Sun, 09 Jul 2006 03:53:13 GMT

> 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
>
>
> --proyal@apache.org - http://fotap.org/~osi
>
>
>


Mime
View raw message