2004-06-01 15:07:54

by Didier Santos Alves

[permalink] [raw]
Subject: Re: [Bluez-devel] Problems while sending and receiving with rfcomm sockects

Hi Julien and Marcel,

When I execute 2 servers on masters side (one only sending and the other =
only
receiving) using diferents rfcomm channels, I also receive corrupt data (=
very
rarely :-( ). If they're both sending or receiving, everything works fine=
... I
think it's possible to use semaphores to synchronize the 2 processes but =
I'd
like to use a simpler solution or at least understand where the problem i=
s.

Regards

Didier

> Am Di, den 01.06.2004 schrieb [email protected] um 13:16:
>
> Hi Didier,
>
> > Hello,
> >
> > I'm writting a server-client application over bluez using rfcomm sock=
ets.
> I've
> > created two threads: one for sending and the other for receiving. The
> problem
> > occurs sometimes (sporadical) and only when I'm sending and receiving=
data
> at
> > the same time: The received data seems to be corrupt... Do I have to =
use
> > mutexes or other synchronizing method?
>
> If you are using wo threads to read/write RFCOMM packets, your
> read/write methods should be synchronized.
>
> Regards,
>
> Julien
>
> > The error ocurrs more often if I execute
> > more than one server at the same time.
> >
> > Thanks.
> >
> > PS: Please tell me if I'm sending this message to the right mailing l=
ist...
> >
> > Didier.
> >
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by: Oracle 10g
> > Get certified on the hottest thing ever to hit the market... Oracle 1=
0g.
> > Take an Oracle 10g class now, and we'll give you the exam FREE.
> > http://ads.osdn.com/?ad_id149&alloc_id=8166&op=3Dclick
> > _______________________________________________
> > Bluez-devel mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/bluez-devel
>
>






-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel


2004-06-06 15:46:44

by Didier Santos Alves

[permalink] [raw]
Subject: [Bluez-devel] Re: Problems while sending and receiving with rfcomm sockects

Hello Marcel,

I've compiled kernel-2.6.6 with the new mh3 patch and now, everything wor=
ks
fine. So, I think it is a kernel bug (2.4.20). It also works without
semaphores.

Just one more thing about this: The number of bytes sent and received is =
the
same but the data received appears shifted by one byte... Strange.

If you're still interested, I'll send you a small program in a few days (=
I have
some work to do for now...).

Once again, thank you Marcel.

Regards,

Didier

> > When I execute 2 servers on masters side (one only sending and the ot=
her
> > only receiving) using diferents rfcomm channels, I also receive corru=
pt
> > data (very rarely :-( ). If they"re both sending or receiving, everyt=
hing
> > works fine...
> >
> > think it"s possible to use semaphores to synchronize the 2 processes =
but I"d
> > like to use a simpler solution or at least understand where the probl=
em is.
>
> if you are using two different RFCOMM channels and this happens it look=
s
> like a bug in the kernel code. As I said, check the latest kernel and
> try to send us a simple program that triggers this effect.





-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
>From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2004-06-01 15:16:39

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-devel] Problems while sending and receiving with rfcomm sockects

Hi Didier,

> When I execute 2 servers on masters side (one only sending and the other only
> receiving) using diferents rfcomm channels, I also receive corrupt data (very
> rarely :-( ). If they're both sending or receiving, everything works fine... I
> think it's possible to use semaphores to synchronize the 2 processes but I'd
> like to use a simpler solution or at least understand where the problem is.

if you are using two different RFCOMM channels and this happens it looks
like a bug in the kernel code. As I said, check the latest kernel and
try to send us a simple program that triggers this effect.

Regards

Marcel




-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel