SSLException in SslHandler; based on SecureChat example

"Trustin Lee (이희승)" trustin at gmail.com
Wed Mar 24 02:33:07 EDT 2010


Hi Jon,

This is an interesting observation.  There might be some thread safety
issue with SSLEnging or SslHandler.  Do you find the same problem with
Netty 3.2.0.BETA1?

Thanks,
Trustin

nollie wrote:
> Hello
> 
> I was having this same issue, although more often.  I wove together the HTTP
> examples with the secure chat example and failed about 45% of the time using
> JDK 5 and Netty 3.1.5.GA.  It didn't look good.
> 
> I sat down with Trustin's test and looked for anything that could be
> different in my code and I found it.
> 
> If you started with the HttpClient example, you probably have this in your
> code:
> 
>         // Wait until the connection attempt succeeds or fails.
>         final Channel channel = future.awaitUninterruptibly().getChannel();
>         if (!future.isSuccess()) {
>           // log failure
>           // exit
>         }
>         // ... otherwise continue
> 
> 
> Change that bit of code to use a listener, like this:
> 
>         future.addListener(new ChannelFutureListener() {
>             public void operationComplete(final ChannelFuture cf) throws
> Exception {
>                 if ( cf.isSuccess() ) {
>                     sendFirstCommand(cf.getChannel());
> 
>                 } else {
>                     // log failure
>                     // exit
>                 }
>             }
>         });
> 
> 
> I made the change and ran 50 times without issue.  Hope this helps.
> 
> 
>  Jon
> 
> 

-- 
what we call human nature in actuality is human habit
http://gleamynode.net/


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
Url : http://lists.jboss.org/pipermail/netty-users/attachments/20100324/70118a1d/attachment-0001.bin 


More information about the netty-users mailing list