Converting from netty2 question
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > Apache Directory Project > Converting from netty2 question




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Converting from netty2 question  
Barry Kaplan


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-09-05 10:45 PM

I'm converting the quicfixj from netty2 to mina and [think] I am nearly 
done. (BTW, I did not write the orignal netty2 layer for quickfixj, so I'm l
earning as I go.)

But I can't figure out one thing. With netty, quickfixj would save off its n
etty Session instances, and on a timer would check if they have dropped thei
r connection. If so it would invoke Session.start().

Is there any corresponding capability in mina? I'm using the ProtocolConnect
or, but it does not seem to retain the socket address after the invocation t
o connect. (Where netty Session did retain this information.) Am I going to 
have to create a little cla
ss to hold onto the socket address for reconnection?

--
barry kaplan
groups1-oTlvBSL8hjVBDgjK7y7TUQ@public.gmane.org






[ Post a follow-up to this message ]



    Re: Converting from netty2 question  
Trustin Lee


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-10-05 07:45 AM

Hi Barry,

2005/6/10, Barry Kaplan <groups1-oTlvBSL8hjVBDgjK7y7TUQ@public.gmane.org>: 
> 
> But I can't figure out one thing. With netty, quickfixj would save off its
 
> netty Session instances, and on a timer would check if they have dropped 
> their connection. If so it would invoke Session.start().
> 
> Is there any corresponding capability in mina? I'm using the 
> ProtocolConnector, but it does not seem to retain the socket address after
 
> the invocation to connect. (Where netty Session did retain this 
> information.) Am I going to have to create a little class to hold onto the
 
> socket address for reconnection?

You're right. I removed Session.start() method. I added IoConnector 
instead. Here is the example code:
public void sessionClosed( ProtocolSession session ) throws Exception
{
// Wait for five seconds before reconnecting; you'll have to perform 
reconnection in other
// thread actually. I just slept here for brevity.
Thread.sleep( 5000 ); 
// Reconnect.
connector.connect( session.getRemoteAddress(), this );
}
Possibly you'd better to extract this code to a method like 'reconnect()' 
so that it can reusable in more than one place.
Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:19 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register