You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Michael Bauroth <Mi...@falcom.de> on 2008/01/03 15:21:07 UTC

SocketConnector functionality

Hello,

is there a special reason, why the NioSocketConnector hasn't the same 
methods like the acceptors (bind, unbind, isBound vs. connect, 
disconnect, isConnected)? Would be fine if somebody could bring some 
more light into this :)

Best Regards
Michael


Re: SocketConnector functionality

Posted by Michael Bauroth <Mi...@falcom.de>.
or so ... ;)

Thanx!
Michael

Francesca Milan schrieb:
> Michael Bauroth ha scritto:
>> Thank you for the quick response. The problem (or the question) is
>> the same: how can I request, which state is currently active:
>> connected or disconnected? And how can I disconnect the connector
>> (instead of each session separately)?
>>
>> Regards
>> Michael
>>
>> Steve Ulrich (proemion) schrieb:
>>> Michael Bauroth wrote:
>>>  
>>>> is there a special reason, why the NioSocketConnector hasn't the
>>>> same methods like the acceptors (bind, unbind, isBound vs. connect,
>>>> disconnect, isConnected)? Would be fine if somebody could bring
>>>> some more light into this :)
>>>>
>>>>     
>>> Hi!
>>> I think that's because the Acceptor listens to at a specific port
>>> and is
>>> therfore bound to this port. Just because an acceptor is bound, that
>>> doesn't
>>> mean that there are any connections. There's even the possibility
>>> that the
>>> Acceptor is unbound but there are still connections to clients,
>>> because the
>>> "real" communication is handled over different ports. A connector
>>> connects
>>> itself to a server, so there are just 2 posibilites: it is connected to
>>> somewhere, or it isn't.
>>>
>>> hth
>>>
>>> Steve
>>
> SocketConnector connector = new SocketConnector(...
> ...
>
> ConnectFuture connectFuture = connector.connect(...);
> connectFuture.join();
> IoSession ioSession = connectFuture.getSession();
>
> ...
> if(ioSession.isConnected()) {
>    .....
> }
> ...
> ioSession.close();
>


Re: SocketConnector functionality

Posted by Francesca Milan <fr...@newvision.it>.
Michael Bauroth ha scritto:
> Thank you for the quick response. The problem (or the question) is the 
> same: how can I request, which state is currently active: connected or 
> disconnected? And how can I disconnect the connector (instead of each 
> session separately)?
>
> Regards
> Michael
>
> Steve Ulrich (proemion) schrieb:
>> Michael Bauroth wrote:
>>  
>>> is there a special reason, why the NioSocketConnector hasn't the 
>>> same methods like the acceptors (bind, unbind, isBound vs. connect, 
>>> disconnect, isConnected)? Would be fine if somebody could bring some 
>>> more light into this :)
>>>
>>>     
>> Hi!
>> I think that's because the Acceptor listens to at a specific port and is
>> therfore bound to this port. Just because an acceptor is bound, that 
>> doesn't
>> mean that there are any connections. There's even the possibility 
>> that the
>> Acceptor is unbound but there are still connections to clients, 
>> because the
>> "real" communication is handled over different ports. A connector 
>> connects
>> itself to a server, so there are just 2 posibilites: it is connected to
>> somewhere, or it isn't.
>>
>> hth
>>
>> Steve
>
SocketConnector connector = new SocketConnector(...
...

ConnectFuture connectFuture = connector.connect(...);
connectFuture.join();
IoSession ioSession = connectFuture.getSession();

...
if(ioSession.isConnected()) {
    .....
}
...
ioSession.close();

Re: SocketConnector functionality

Posted by Michael Bauroth <Mi...@falcom.de>.
Thank you for the quick response. The problem (or the question) is the 
same: how can I request, which state is currently active: connected or 
disconnected? And how can I disconnect the connector (instead of each 
session separately)?

Regards
Michael

Steve Ulrich (proemion) schrieb:
> Michael Bauroth wrote:
>   
>> is there a special reason, why the NioSocketConnector hasn't the same 
>> methods like the acceptors (bind, unbind, isBound vs. connect, 
>> disconnect, isConnected)? Would be fine if somebody could bring some 
>> more light into this :)
>>
>>     
> Hi!
> I think that's because the Acceptor listens to at a specific port and is
> therfore bound to this port. Just because an acceptor is bound, that doesn't
> mean that there are any connections. There's even the possibility that the
> Acceptor is unbound but there are still connections to clients, because the
> "real" communication is handled over different ports. A connector connects
> itself to a server, so there are just 2 posibilites: it is connected to
> somewhere, or it isn't.
>
> hth
>
> Steve


Re: SocketConnector functionality

Posted by "Steve Ulrich (proemion)" <st...@proemion.com>.

Michael Bauroth wrote:
> 
> is there a special reason, why the NioSocketConnector hasn't the same 
> methods like the acceptors (bind, unbind, isBound vs. connect, 
> disconnect, isConnected)? Would be fine if somebody could bring some 
> more light into this :)
> 
Hi!
I think that's because the Acceptor listens to at a specific port and is
therfore bound to this port. Just because an acceptor is bound, that doesn't
mean that there are any connections. There's even the possibility that the
Acceptor is unbound but there are still connections to clients, because the
"real" communication is handled over different ports. A connector connects
itself to a server, so there are just 2 posibilites: it is connected to
somewhere, or it isn't.

hth

Steve
-- 
View this message in context: http://www.nabble.com/SocketConnector-functionality-tp14597736s16868p14598135.html
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.