mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peter royal <pro...@apache.org>
Subject Re: SocketConnector object utilization
Date Fri, 07 Jul 2006 16:38:33 GMT
On Jul 7, 2006, at 12:16 PM, <cinod79@gmail.com> <cinod79@gmail.com>  
wrote:
> Is there a way for me produce an IoAcceptor behaviour on the client  
> side? A shared across IoHandler for connectors (of course with  
> different sessions).

sure, just pass the same IoHandler instance in each time you  
call .connect() :)

-pete

>
> ----- Original Message ----- From: "peter royal" <proyal@apache.org>
> To: <mina-dev@directory.apache.org>
> Sent: Friday, July 07, 2006 11:53 PM
> Subject: Re: SocketConnector object utilization
>
>
>> On Jul 7, 2006, at 11:49 AM, <cinod79@gmail.com>  
>> <cinod79@gmail.com> wrote:
>>> Does
>>>  SocketConnector connector = new SocketConnector();  
>>> connector.connect(
>>>                 new InetSocketAddress( "localhost",
>>>                 Integer.parseInt( 54321 ) ),
>>>                 new MyProtocolHandler() );Uses MyProtocolHandler 
>>> ()  from a pre used cache?I have an application that transmit  
>>> images to  a server.Each images are not sent via bulk and are  
>>> sent independently,Because of that, i would need to create a new  
>>> MyProtocolHandler() instance for every connection.Would there be  
>>> a better implementation for this?
>>
>> For the connector side, the IoHandler that you pass in is for  
>> just  that one connection.
>>
>> This is opposite from the IoAcceptor side.. It takes an  
>> IoHandler,  but it is shared amongst all connections accepted.
>>
>> In this situation, you will get the behavior that you want.
>>
>> -pete
>>
>>
>> -- 
>> proyal@apache.org - http://fotap.org/~osi
>>
>>
>>
>
>
>


-- 
proyal@apache.org - http://fotap.org/~osi




Mime
View raw message