You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Rajesh Bhatiya <Ra...@SierraAtlantic.com> on 2006/04/29 18:43:30 UTC

MINA 0.8.1 - Unbind on TCP socket connection hangs

Hi,

We are using MINA 0.8.1 API for reading and sending data over TCP socket layer. We want to "cycle" the server socket (i.e. close then reconnect) if it does not receive any packet for a period of 40 seconds. To achieve this we are using unbind() and bind() methods of "SimpleServiceRegistry" class. But the program hangs during the unbind() operation.

Can you please tell us as how can we achieve this functionality of socket "cycling" (i.e. close then reconnect) using MINA 0.8.1 API ? 

Thanks and Regards,
Rajesh

DISCLAIMER:"The information contained in this message and the attachments (if any) may be privileged and confidential and protected from disclosure. You are hereby notified that any unauthorized use, dissemination, distribution or copying of this communication, review, retransmission, or taking of any action based upon this information, by persons or entities other than the intended recipient, is strictly prohibited. If you are not the intended recipient or an employee or agent responsible for delivering this message, and have received this communication in error, please notify us immediately by replying to the message and kindly delete the original message, attachments, if any, and all its copies from your computer system. Thank you for your cooperation."

Re: MINA 0.8.1 - Unbind on TCP socket connection hangs

Posted by Maarten Bosteels <ma...@dns.be>.
I once tried to implement a clean shutdown method for 0.8.1
but it did not work because of a deadlock.
Unfortunately I don't remember which threads were waiting for each other.
It is already some months ago and I decided to wait until I had
upgraded to mina 0.9.x (which I haven't done yet).

Not much help I know, but I at least it confirms what you are seeing:
the application hangs.

Maarten

On 5/1/06, Trustin Lee <tr...@gmail.com> wrote:
> On 5/1/06, peter royal <pr...@apache.org> wrote:
> >
> > On Apr 29, 2006, at 12:43 PM, Rajesh Bhatiya wrote:
> > > We are using MINA 0.8.1 API for reading and sending data over TCP
> > > socket layer. We want to "cycle" the server socket (i.e. close then
> > > reconnect) if it does not receive any packet for a period of 40
> > > seconds. To achieve this we are using unbind() and bind() methods
> > > of "SimpleServiceRegistry" class. But the program hangs during the
> > > unbind() operation.
> >
> > Have you done a thread dump when the program is "hung"? 'kill -QUIT
> > <pid>' on unix-like systems. Check the java documentation on how to
> > do this on windows. This will help find the cause of the hang.
>
>
> On Windows, you have to press 'CTRL+BREAK' (not 'CTRL+C').
>
> Trustin
> --
> what we call human nature is actually human habit
> --
> http://gleamynode.net/
> --
> PGP key fingerprints:
> * E167 E6AF E73A CBCE EE41  4A29 544D DE48 FE95 4E7E
> * B693 628E 6047 4F8F CFA4  455E 1C62 A7DC 0255 ECA6
>
>

Re: MINA 0.8.1 - Unbind on TCP socket connection hangs

Posted by Trustin Lee <tr...@gmail.com>.
On 5/1/06, peter royal <pr...@apache.org> wrote:
>
> On Apr 29, 2006, at 12:43 PM, Rajesh Bhatiya wrote:
> > We are using MINA 0.8.1 API for reading and sending data over TCP
> > socket layer. We want to "cycle" the server socket (i.e. close then
> > reconnect) if it does not receive any packet for a period of 40
> > seconds. To achieve this we are using unbind() and bind() methods
> > of "SimpleServiceRegistry" class. But the program hangs during the
> > unbind() operation.
>
> Have you done a thread dump when the program is "hung"? 'kill -QUIT
> <pid>' on unix-like systems. Check the java documentation on how to
> do this on windows. This will help find the cause of the hang.


On Windows, you have to press 'CTRL+BREAK' (not 'CTRL+C').

Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP key fingerprints:
* E167 E6AF E73A CBCE EE41  4A29 544D DE48 FE95 4E7E
* B693 628E 6047 4F8F CFA4  455E 1C62 A7DC 0255 ECA6

Re: MINA 0.8.1 - Unbind on TCP socket connection hangs

Posted by peter royal <pr...@apache.org>.
On Apr 29, 2006, at 12:43 PM, Rajesh Bhatiya wrote:
> We are using MINA 0.8.1 API for reading and sending data over TCP  
> socket layer. We want to "cycle" the server socket (i.e. close then  
> reconnect) if it does not receive any packet for a period of 40  
> seconds. To achieve this we are using unbind() and bind() methods  
> of "SimpleServiceRegistry" class. But the program hangs during the  
> unbind() operation.

Have you done a thread dump when the program is "hung"? 'kill -QUIT  
<pid>' on unix-like systems. Check the java documentation on how to  
do this on windows. This will help find the cause of the hang.

> Can you please tell us as how can we achieve this functionality of  
> socket "cycling" (i.e. close then reconnect) using MINA 0.8.1 API ?

Sounds like you're doing it the correct way, but you're encountering  
a bug.

Why do you have to cycle the server socket though?
-pete

-- 
proyal@apache.org - http://fotap.org/~osi