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 17:45:33 GMT

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


Mime
View raw message