logo       

RE: Rfcomm Use Count: msg#00071

linux.bluez.devel

Subject: RE: Rfcomm Use Count

Marcel,

> > With my suggestion above the condition would be handled by
> either accept()
> > or cleanup_listen(), whichever is called first. Though I
> guess you could
> > still consider that to be garbage collection.
>
> when it is handled in ..cleanup_listen() then it gets handled when you
> kill the server process. I think this is far too late, because you can
> have more than one connection attempts in between. We must handle this
> when we close the connection.

Agreed, but if bluez_accept_dequeue() returns closed connections then it can
also be handled in accept(). So this would only be an issue in situations
where a socket is listening for a long time without there ever being a call
to accept().

The topic of cleanup_listen() came up just because the only way it has
appeared for me in normal use was with incomming connections while the
server was being shut down. While the server is running, incomming
connections are returned by accept() before they get closed by the remote
side.

It is still unclear to me why I could not bind to the socket (error was
address already in use, 98) when I tried to restart the server. This
behaviour is not seen with the simple test program I sent last week (and so
might be unrelated).

> This is correct and so I don't really like this approach. I
> think there
> is a simply logic mistake in the closing path of the RFCOMM code.

Could be. Then the closing path of the rfcomm code would need to be able to
remove connections from the accept queue. This might be a difficult change.

-Daryl.



-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise