* [Bluez-devel] Problems while sending and receiving with rfcomm sockects
@ 2004-06-01 11:16 dsas
2004-06-01 12:34 ` Marcel Holtmann
[not found] ` <1086094054.1978.26.camel@fischer>
0 siblings, 2 replies; 12+ messages in thread
From: dsas @ 2004-06-01 11:16 UTC (permalink / raw)
To: bluez-devel
Hello,
I'm writting a server-client application over bluez using rfcomm sockets.=
I've
created two threads: one for sending and the other for receiving. The pro=
blem
occurs sometimes (sporadical) and only when I'm sending and receiving dat=
a at
the same time: The received data seems to be corrupt... Do I have to use
mutexes or other synchronizing method? The error ocurrs more often if I e=
xecute
more than one server at the same time.
Thanks.
PS: Please tell me if I'm sending this message to the right mailing list.=
..
Didier.
-------------------------------------------------------
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
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [Bluez-devel] Problems while sending and receiving with rfcomm sockects
2004-06-01 11:16 [Bluez-devel] Problems while sending and receiving with rfcomm sockects dsas
@ 2004-06-01 12:34 ` Marcel Holtmann
2004-06-01 12:56 ` Collin R. Mulliner
[not found] ` <1086094626.40bc7d22eab66@webmail.rnl.ist.utl.pt>
[not found] ` <1086094054.1978.26.camel@fischer>
1 sibling, 2 replies; 12+ messages in thread
From: Marcel Holtmann @ 2004-06-01 12:34 UTC (permalink / raw)
To: dsas; +Cc: BlueZ Mailing List
Hi Didier,
> I'm writting a server-client application over bluez using rfcomm sockets. 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? The error ocurrs more often if I execute
> more than one server at the same time.
I never used RFCOMM in a multi-threaded program. Actually I avoid to use
threads wherever possible. However sending and receiving at the same
time should work. Maybe there is a kernel bug, what version do you use?
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
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [Bluez-devel] Problems while sending and receiving with rfcomm sockects
2004-06-01 12:34 ` Marcel Holtmann
@ 2004-06-01 12:56 ` Collin R. Mulliner
2004-06-01 14:31 ` Marcel Holtmann
[not found] ` <1086094626.40bc7d22eab66@webmail.rnl.ist.utl.pt>
1 sibling, 1 reply; 12+ messages in thread
From: Collin R. Mulliner @ 2004-06-01 12:56 UTC (permalink / raw)
To: bluez-devel
Hi,
> I never used RFCOMM in a multi-threaded program. Actually I avoid to
> use threads wherever possible. However sending and receiving at the
> same time should work. Maybe there is a kernel bug, what version do
> you use?
I allways thought one should ONLY use a socket within a single thread
at the same time. I write my programs in that way that I never call
read() and write() on a specific socket at the "same time" also I
only access each socket within a single thread.
Somehting else: I need a UUID for my application - any hints on where to
find some information/instructions?
... Collin
--
Collin R. Mulliner <collin@betaversion.net>
BETAVERSiON Systems [www.betaversion.net]
info/pgp: finger collin@betaversion.net
Sun light is good, if it stays outside of my room!
-------------------------------------------------------
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
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [Bluez-devel] Problems while sending and receiving with rfcomm sockects
2004-06-01 12:56 ` Collin R. Mulliner
@ 2004-06-01 14:31 ` Marcel Holtmann
0 siblings, 0 replies; 12+ messages in thread
From: Marcel Holtmann @ 2004-06-01 14:31 UTC (permalink / raw)
To: Collin R. Mulliner; +Cc: BlueZ Mailing List
Hi Collin,
> > I never used RFCOMM in a multi-threaded program. Actually I avoid to
> > use threads wherever possible. However sending and receiving at the
> > same time should work. Maybe there is a kernel bug, what version do
> > you use?
>
> I allways thought one should ONLY use a socket within a single thread
> at the same time. I write my programs in that way that I never call
> read() and write() on a specific socket at the "same time" also I
> only access each socket within a single thread.
this is why we have select() and poll().
> Somehting else: I need a UUID for my application - any hints on where to
> find some information/instructions?
You must create a UUID-128. There was note in the specification about
that, but I can't remember it.
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
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
[parent not found: <1086094626.40bc7d22eab66@webmail.rnl.ist.utl.pt>]
[parent not found: <1086094054.1978.26.camel@fischer>]
* Re: [Bluez-devel] Problems while sending and receiving with rfcomm sockects
[not found] ` <1086094054.1978.26.camel@fischer>
@ 2004-06-01 15:07 ` dsas
2004-06-01 15:16 ` Marcel Holtmann
2004-06-06 15:46 ` [Bluez-devel] " dsas
0 siblings, 2 replies; 12+ messages in thread
From: dsas @ 2004-06-01 15:07 UTC (permalink / raw)
To: bluez-devel
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 dsas@mega.ist.utl.pt 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
> > Bluez-devel@lists.sourceforge.net
> > 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
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [Bluez-devel] Problems while sending and receiving with rfcomm sockects
2004-06-01 15:07 ` dsas
@ 2004-06-01 15:16 ` Marcel Holtmann
2004-06-06 15:46 ` [Bluez-devel] " dsas
1 sibling, 0 replies; 12+ messages in thread
From: Marcel Holtmann @ 2004-06-01 15:16 UTC (permalink / raw)
To: dsas; +Cc: BlueZ Mailing List
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
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bluez-devel] Re: Problems while sending and receiving with rfcomm sockects
2004-06-01 15:07 ` dsas
2004-06-01 15:16 ` Marcel Holtmann
@ 2004-06-06 15:46 ` dsas
2004-06-06 15:59 ` Marcel Holtmann
1 sibling, 1 reply; 12+ messages in thread
From: dsas @ 2004-06-06 15:46 UTC (permalink / raw)
To: bluez-devel
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
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Bluez-devel] Re: Problems while sending and receiving with rfcomm sockects
2004-06-06 15:46 ` [Bluez-devel] " dsas
@ 2004-06-06 15:59 ` Marcel Holtmann
2004-06-06 16:16 ` dsas
0 siblings, 1 reply; 12+ messages in thread
From: Marcel Holtmann @ 2004-06-06 15:59 UTC (permalink / raw)
To: dsas; +Cc: BlueZ Mailing List
Hi Didier,
> I've compiled kernel-2.6.6 with the new mh3 patch and now, everything works
> fine. So, I think it is a kernel bug (2.4.20). It also works without
> semaphores.
this is good to hear.
> 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.
How do you compare this? You don't use hcidump for it, do you? All
version prior 1.8 don't decode the credit based flow control byte
correctly. They show it as part of the payload.
> If you're still interested, I'll send you a small program in a few days (I have
> some work to do for now...).
Please do so. I must assure that we don't have a kernel bug here.
Regards
Marcel
-------------------------------------------------------
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
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bluez-devel] Re: Problems while sending and receiving with rfcomm sockects
2004-06-06 15:59 ` Marcel Holtmann
@ 2004-06-06 16:16 ` dsas
2004-06-06 16:26 ` Marcel Holtmann
2004-06-06 20:52 ` Marcel Holtmann
0 siblings, 2 replies; 12+ messages in thread
From: dsas @ 2004-06-06 16:16 UTC (permalink / raw)
To: bluez-devel
Hi Marcel,
No, I don't use hcidump. I simply compare the array of chars passed in se=
nd()
with the one I receive with recv().
Regards,
Didier
> > 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=
.
>
> How do you compare this? You don't use hcidump for it, do you? All
> version prior 1.8 don't decode the credit based flow control byte
> correctly. They show it as part of the payload.
-------------------------------------------------------
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
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Bluez-devel] Re: Problems while sending and receiving with rfcomm sockects
2004-06-06 16:16 ` dsas
@ 2004-06-06 16:26 ` Marcel Holtmann
2004-06-06 20:52 ` Marcel Holtmann
1 sibling, 0 replies; 12+ messages in thread
From: Marcel Holtmann @ 2004-06-06 16:26 UTC (permalink / raw)
To: dsas; +Cc: BlueZ Mailing List
Hi Didier,
> No, I don't use hcidump. I simply compare the array of chars passed in send()
> with the one I receive with recv().
then I really need a simple program that triggers this effect. It must
be a kernel bug and we should solve it.
Btw is there any difference when you use write() and read()?
Regards
Marcel
-------------------------------------------------------
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
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Bluez-devel] Re: Problems while sending and receiving with rfcomm sockects
2004-06-06 16:16 ` dsas
2004-06-06 16:26 ` Marcel Holtmann
@ 2004-06-06 20:52 ` Marcel Holtmann
1 sibling, 0 replies; 12+ messages in thread
From: Marcel Holtmann @ 2004-06-06 20:52 UTC (permalink / raw)
To: dsas; +Cc: BlueZ Mailing List
Hi Didier,
> No, I don't use hcidump. I simply compare the array of chars passed in send()
> with the one I receive with recv().
please use read() and write() to be sure that it not a problem of send()
or recv().
Regards
Marcel
-------------------------------------------------------
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
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2004-06-06 20:52 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-01 11:16 [Bluez-devel] Problems while sending and receiving with rfcomm sockects dsas
2004-06-01 12:34 ` Marcel Holtmann
2004-06-01 12:56 ` Collin R. Mulliner
2004-06-01 14:31 ` Marcel Holtmann
[not found] ` <1086094626.40bc7d22eab66@webmail.rnl.ist.utl.pt>
2004-06-01 14:32 ` Marcel Holtmann
[not found] ` <1086094054.1978.26.camel@fischer>
2004-06-01 15:07 ` dsas
2004-06-01 15:16 ` Marcel Holtmann
2004-06-06 15:46 ` [Bluez-devel] " dsas
2004-06-06 15:59 ` Marcel Holtmann
2004-06-06 16:16 ` dsas
2004-06-06 16:26 ` Marcel Holtmann
2004-06-06 20:52 ` Marcel Holtmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox