users@grizzly.java.net

Re: Problem with SSL

From: quende <skrinnikov_at_gmail.com>
Date: Tue, 30 Sep 2008 03:14:07 -0700 (PDT)

Hello Alexey,

I have a map in server's class
private ConcurrentHashMap<SelectionKey, Client> _clientsMap;

which I update from a class extending SSLSelectorHandler when i get Accept
interest

@Override
    public boolean onAcceptInterest(SelectionKey key, Context ctx) throws
IOException
    {
        SelectableChannel _channel = acceptWithoutRegistration(key);
        if (_channel != null)
        {
            configureChannel(_channel);
            SelectionKey readKey = _channel.register(selector,
SelectionKey.OP_READ);
            readKey.attach(System.currentTimeMillis());
            Server.getInstance().addClient(readKey); //here is where i add
the key to collection
        }
        return false;
    }

Or should i make any check of the result of handshaking before dealing with
that key? I thought, that even if handshake has failed, i would
cancel/remove that key later during the first isValid() check. Am I wrong,
isn't the key i store in my collection the right one to perform write
operations with? Do I have to attach something to this key?

Thank you,
-- Quende


Oleksiy Stashok wrote:
>
> Hi Quende,
>
> according to your example... how do you create client connection,
> where you take clientSelectionKey?
> Cause client connection should pass the handshake phase, which
> probably is missed in your scenario.
>
> If you can share more code, it could help! :)
>
> Thank you.
>
> WBR,
> Alexey.
>
>

-- 
View this message in context: http://www.nabble.com/Problem-with-SSL-tp19709902p19739385.html
Sent from the Grizzly - Users mailing list archive at Nabble.com.