You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by wunderbar <wu...@hotmail.com> on 2007/08/31 06:09:04 UTC

setConnectTimeout. Server not instantiated

Hi all,

I am trying to work out if there is a MINA way for a client to block waiting
to obtain a connection to a server when the server may not be instantiated
at that point in time.

Other than identifying a RuntimeIOException when the
SocketConnector.connect() and subsequent retrieval of the session fails, and
in turn putting the thread to sleep for x seconds, is there a way to do this
via setConnectTimeout or equivalent.

I believe setConnectTimeout(x) behaves only when there is a Server on the
port the Client is trying to connect on correct?

Ta,
Mark
-- 
View this message in context: http://www.nabble.com/setConnectTimeout.-Server-not-instantiated-tf4358183s16868.html#a12420430
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.


Re: setConnectTimeout. Server not instantiated

Posted by wunderbar <wu...@hotmail.com>.
Thanks. I thought that might be the case!

Cheers,
Mark


Maarten Bosteels-4 wrote:
> 
> On 8/31/07, wunderbar <wu...@hotmail.com> wrote:
>>
>>
>> Hi all,
>>
>> I am trying to work out if there is a MINA way for a client to block
>> waiting
>> to obtain a connection to a server when the server may not be
>> instantiated
>> at that point in time.
>>
>> Other than identifying a RuntimeIOException when the
>> SocketConnector.connect() and subsequent retrieval of the session fails,
>> and
>> in turn putting the thread to sleep for x seconds, is there a way to do
>> this
>> via setConnectTimeout or equivalent.
>>
>> I believe setConnectTimeout(x) behaves only when there is a Server on the
>> port the Client is trying to connect on correct?
> 
> 
> 
> Indeed,  when the server is not yet listening on the port, the OS will
> return "Connection refused"
> I don't think connectTimeout will help in that case.
> 
> Maarten
> 
> Ta,
>> Mark
>> --
>> View this message in context:
>> http://www.nabble.com/setConnectTimeout.-Server-not-instantiated-tf4358183s16868.html#a12420430
>> Sent from the Apache MINA Support Forum mailing list archive at
>> Nabble.com
>> .
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/setConnectTimeout.-Server-not-instantiated-tf4358183s16868.html#a12424392
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.


Re: setConnectTimeout. Server not instantiated

Posted by Maarten Bosteels <mb...@gmail.com>.
On 8/31/07, wunderbar <wu...@hotmail.com> wrote:
>
>
> Hi all,
>
> I am trying to work out if there is a MINA way for a client to block
> waiting
> to obtain a connection to a server when the server may not be instantiated
> at that point in time.
>
> Other than identifying a RuntimeIOException when the
> SocketConnector.connect() and subsequent retrieval of the session fails,
> and
> in turn putting the thread to sleep for x seconds, is there a way to do
> this
> via setConnectTimeout or equivalent.
>
> I believe setConnectTimeout(x) behaves only when there is a Server on the
> port the Client is trying to connect on correct?



Indeed,  when the server is not yet listening on the port, the OS will
return "Connection refused"
I don't think connectTimeout will help in that case.

Maarten

Ta,
> Mark
> --
> View this message in context:
> http://www.nabble.com/setConnectTimeout.-Server-not-instantiated-tf4358183s16868.html#a12420430
> Sent from the Apache MINA Support Forum mailing list archive at Nabble.com
> .
>
>