[Rxtx] forced close of port
--
ideiglenes1 at freemail.hu
Thu Dec 29 13:21:08 MST 2005
Okay, its working now. Port can be closed and I can reuse it in a whole
new connection if BT unit is in reach again. Thanks for the help! Please
include this in the next release, so I can release my software with this
new functionality... (until now I had to System.exit() and restart
program with the my runner shell script ;-) )
If I can release I will send you my brand new application's link so you
can include it in your RXTX homepage's 'what project uses RXTX' page. :)
On cs, 2005-12-29 at 21:15 +0100, -- wrote:
> That's exactly what I saw would be necessary to handle the situation.
> The patch Gerrit has kindly sent me didnt help my problem. This one you
> wrote I think will. I will patch it by own hand right now and tell what
> happened.
> Thanks!
>
> On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote:
> > On Thu, 29 Dec 2005, -- wrote:
> >
> > > Hi Rxtx mailing list people!
> > >
> > > I am using rxtx for communication on bluetooth rfcomm serial device.
> > > Rxtx is working well and is perfectly usable.
> > >
> > > But.. I have one small problem with closing the port. As this is a
> > > bluetooth connection, bt unit can close its connection on one side
> > > without notification. It is just a binded rfcomm connection. In that
> > > case later, when program tries to write on connection, it return write
> > > error. I want to handle it, and close the port, but it is blocked by
> > > RXTXPort's IOLock! there is an unfinished and failed write attempt,
> > > IOLock is increased ++, and so I cannot close the port for later reuse!
> > > Can you please provide a forced close, or some kindof closeing which
> > > will make the port reusable again after a broken connection?
> > >
> >
> >
> > Does something like this solve the problem? There are 3 writes so the
> > code could either be cleaned up or look for the writeArrays to hack it
> > into RXTXPort.java.
> >
> > try {
> > writeArray( send, 0, len, monThreadisInterrupted );
> > } catch ( IOException e )
> > {
> > IOLocked--;
> > throw e;
> > }
> >
> > _______________________________________________
> > Rxtx mailing list
> > Rxtx at qbang.org
> > http://mailman.qbang.org/mailman/listinfo/rxtx
> >
More information about the Rxtx
mailing list