You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by peter royal <pr...@apache.org> on 2006/05/01 16:03:53 UTC

Re: MINA 0.8.1 - Unbind on TCP socket connection hangs

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



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