* [Bluez-devel] Concurrency / Multi processing questions
@ 2006-10-27 20:50 Olivier Le Pogam
2006-10-29 14:25 ` Peter Wippich
0 siblings, 1 reply; 7+ messages in thread
From: Olivier Le Pogam @ 2006-10-27 20:50 UTC (permalink / raw)
To: bluez-devel
[-- Attachment #1.1: Type: text/plain, Size: 1263 bytes --]
Hi,
I think having understood the main concepts of RFCOMM
connections (DLC, DLCI ...) however I really wonder about
multi processing (globally and in BlueZ specifically)
- If I want to write a service (published in the SDP) for example
on channel 9, can I write a forking server (forking at each accept
so it can accept a new incoming connection from another
remote device while the first connection is being managed ?)
We assume we have only one bdaddr (bluetooth adaptor) in local
I suppose it could lead to 2 concurrent connection tuples like these ones :
( (local_bdaddr, channel 9) - (remote1_addr, channel9) )
( (local_bdaddr, channel 9) - (remote2_addr, channel9) )
Is it possible ? Without any conflicts ? I know on the local service
we would have the same DLCI for both sockets. In TCP it would be
possible with REUSEADDR, would it be the same here ?
- Now taking a reverse problem, let's assume I have a client
application that will "push" content to mobile phones, on channel 9.
Can I run concurrent pushers on my computer ?
Concurrent tuples would look like the same as formerly, except
that the server / client roles are reversed here.
Thanks a lot for helping me, believe I have searched a lot before
asking !
Oli
[-- Attachment #1.2: Type: text/html, Size: 2894 bytes --]
[-- Attachment #2: "AVG certification" --]
[-- Type: text/plain, Size: 151 bytes --]
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.408 / Virus Database: 268.13.11/497 - Release Date: 25/10/2006
[-- Attachment #3: Type: text/plain, Size: 373 bytes --]
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
[-- Attachment #4: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Bluez-devel] Concurrency / Multi processing questions
2006-10-27 20:50 [Bluez-devel] Concurrency / Multi processing questions Olivier Le Pogam
@ 2006-10-29 14:25 ` Peter Wippich
2006-10-29 19:52 ` Olivier Le Pogam
2006-10-29 20:00 ` Marcel Holtmann
0 siblings, 2 replies; 7+ messages in thread
From: Peter Wippich @ 2006-10-29 14:25 UTC (permalink / raw)
To: Olivier Le Pogam, BlueZ development
Hello Oli,
On Fri, 27 Oct 2006, Olivier Le Pogam wrote:
> Hi,
>
> I think having understood the main concepts of RFCOMM
> connections (DLC, DLCI ...) however I really wonder about
> multi processing (globally and in BlueZ specifically)
>
> - If I want to write a service (published in the SDP) for example
> on channel 9, can I write a forking server (forking at each accept
> so it can accept a new incoming connection from another
> remote device while the first connection is being managed ?)
> We assume we have only one bdaddr (bluetooth adaptor) in local
>
> I suppose it could lead to 2 concurrent connection tuples like these ones :
> ( (local_bdaddr, channel 9) - (remote1_addr, channel9) )
> ( (local_bdaddr, channel 9) - (remote2_addr, channel9) )
>
> Is it possible ? Without any conflicts ? I know on the local service
> we would have the same DLCI for both sockets. In TCP it would be
> possible with REUSEADDR, would it be the same here ?
This would not be possible. You can only have have one connection on a
single server channel number (SCN). This is not a problem of BlueZ but a
general Bluetooth issue. It may be possible to change the bluetooth stack
in a way which will support a scenario aas described above, but I think
this won't be a trivial task. And I'm not sure if it will still comply to
the standard.
> - Now taking a reverse problem, let's assume I have a client
> application that will "push" content to mobile phones, on channel 9.
> Can I run concurrent pushers on my computer ?
> Concurrent tuples would look like the same as formerly, except
> that the server / client roles are reversed here.
This won't be a problem as long as you just have a single connection to
each remote device. The reason is that for every outgoing connection a new
local channel will be allocated which is independend from he remote server
channel you connect to.
Ciao,
Peter
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Bluez-devel] Concurrency / Multi processing questions
2006-10-29 14:25 ` Peter Wippich
@ 2006-10-29 19:52 ` Olivier Le Pogam
2006-10-29 20:00 ` Marcel Holtmann
1 sibling, 0 replies; 7+ messages in thread
From: Olivier Le Pogam @ 2006-10-29 19:52 UTC (permalink / raw)
To: BlueZ development
Hi Peter,
Thanks for your answers !
> This would not be possible. You can only have have one connection on a
> single server channel number (SCN). This is not a problem of BlueZ but a
> general Bluetooth issue. It may be possible to change the bluetooth stack
> in a way which will support a scenario aas described above, but I think
> this won't be a trivial task. And I'm not sure if it will still comply to
> the standard.
Damn, it means that if I want a service (UUID, RFCOMM channel)
to be available concurrently to several remote devices from a unique
computer, I need to have as many BlueTooth adaptors as possible
concurrent remote devices, and a service declared on the SDP for
each one ? and basically each Service server is a loop on listen / accept /
process /close without any fork, am I right ?
>> - Now taking a reverse problem, let's assume I have a client
>> application that will "push" content to mobile phones, on channel 9.
> This won't be a problem as long as you just have a single connection to
> each remote device. The reason is that for every outgoing connection a new
> local channel will be allocated which is independend from he remote server
> channel you connect to.
Ok, according to the former principle I suppose i.e. one service <=> one
concurrent connection to that service for an adaptor.
I have a binding question here : I've made simple tests, doing simple socket
applications (connect / send / close) from a computer to a another one,
and if for example I have declared a service on the second computer (let's
say on channel 14), when the client application is bound it's on local
channel
14 too (after a getsockname client-side), i've understood it's because of
the DLC
which is unique on both side of RFCOMM. Now let's assume I open another
application concurrently client-side, connecting to another remote device
but on channel 14 too, it will be smooth ? (I ask this question because you
say
"The reason is that for every outgoing connection a new local channel will
be
allocated which is independend from he remote server channel you connect
to")
and experience has showed something different. I will try more !!
Basically, it would be a computer trying to push data on as many remote
devices
as possible on the same remote channel, and I would like to use the max
connections
possible for each bluetooth adaptor !
Thanks **a lot** for your help !!
Oli
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.408 / Virus Database: 268.13.17/505 - Release Date: 27/10/2006
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Bluez-devel] Concurrency / Multi processing questions
2006-10-29 14:25 ` Peter Wippich
2006-10-29 19:52 ` Olivier Le Pogam
@ 2006-10-29 20:00 ` Marcel Holtmann
2006-10-30 12:45 ` Peter Wippich
1 sibling, 1 reply; 7+ messages in thread
From: Marcel Holtmann @ 2006-10-29 20:00 UTC (permalink / raw)
To: BlueZ development
Hi Peter,
> > I think having understood the main concepts of RFCOMM
> > connections (DLC, DLCI ...) however I really wonder about
> > multi processing (globally and in BlueZ specifically)
> >
> > - If I want to write a service (published in the SDP) for example
> > on channel 9, can I write a forking server (forking at each accept
> > so it can accept a new incoming connection from another
> > remote device while the first connection is being managed ?)
> > We assume we have only one bdaddr (bluetooth adaptor) in local
> >
> > I suppose it could lead to 2 concurrent connection tuples like these ones :
> > ( (local_bdaddr, channel 9) - (remote1_addr, channel9) )
> > ( (local_bdaddr, channel 9) - (remote2_addr, channel9) )
> >
> > Is it possible ? Without any conflicts ? I know on the local service
> > we would have the same DLCI for both sockets. In TCP it would be
> > possible with REUSEADDR, would it be the same here ?
>
> This would not be possible. You can only have have one connection on a
> single server channel number (SCN). This is not a problem of BlueZ but a
> general Bluetooth issue. It may be possible to change the bluetooth stack
> in a way which will support a scenario aas described above, but I think
> this won't be a trivial task. And I'm not sure if it will still comply to
> the standard.
actually this works perfectly fine. On each ACL link between two devices
you have 30 RFCOMM channels in one direction and another 30 in the other
direction. All RFCOMM restrictions are per ACL link.
> > - Now taking a reverse problem, let's assume I have a client
> > application that will "push" content to mobile phones, on channel 9.
> > Can I run concurrent pushers on my computer ?
> > Concurrent tuples would look like the same as formerly, except
> > that the server / client roles are reversed here.
> This won't be a problem as long as you just have a single connection to
> each remote device. The reason is that for every outgoing connection a new
> local channel will be allocated which is independend from he remote server
> channel you connect to.
Precisely and it the same for incoming connections.
Regards
Marcel
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Bluez-devel] Concurrency / Multi processing questions
2006-10-29 20:00 ` Marcel Holtmann
@ 2006-10-30 12:45 ` Peter Wippich
2006-10-30 12:57 ` Marcel Holtmann
0 siblings, 1 reply; 7+ messages in thread
From: Peter Wippich @ 2006-10-30 12:45 UTC (permalink / raw)
To: BlueZ development
Hi Marcel,
On Sun, 29 Oct 2006, Marcel Holtmann wrote:
> Hi Peter,
>
> > > I think having understood the main concepts of RFCOMM
> > > connections (DLC, DLCI ...) however I really wonder about
> > > multi processing (globally and in BlueZ specifically)
> > >
> > > - If I want to write a service (published in the SDP) for example
> > > on channel 9, can I write a forking server (forking at each accept
> > > so it can accept a new incoming connection from another
> > > remote device while the first connection is being managed ?)
> > > We assume we have only one bdaddr (bluetooth adaptor) in local
> > >
> > > I suppose it could lead to 2 concurrent connection tuples like these ones :
> > > ( (local_bdaddr, channel 9) - (remote1_addr, channel9) )
> > > ( (local_bdaddr, channel 9) - (remote2_addr, channel9) )
> > >
> > > Is it possible ? Without any conflicts ? I know on the local service
> > > we would have the same DLCI for both sockets. In TCP it would be
> > > possible with REUSEADDR, would it be the same here ?
> >
> > This would not be possible. You can only have have one connection on a
> > single server channel number (SCN). This is not a problem of BlueZ but a
> > general Bluetooth issue. It may be possible to change the bluetooth stack
> > in a way which will support a scenario aas described above, but I think
> > this won't be a trivial task. And I'm not sure if it will still comply to
> > the standard.
>
> actually this works perfectly fine. On each ACL link between two devices
> you have 30 RFCOMM channels in one direction and another 30 in the other
> direction. All RFCOMM restrictions are per ACL link.
Ok, I think I've to get into this a little bit deeper. I think it's right
that the RFC restrictions in general are per ACL link (or more precise per
multiplexer session). On the other hand you can only have one
listening session on a single SCN at a time. This means you have to fork a
new listener once a session is started, right ?
Ciao,
Peter
| Peter Wippich Voice: +49 30 46776411 |
| G&W Instruments GmbH fax: +49 30 46776419 |
| Gustav-Meyer-Allee 25, Geb. 12 Email: pewi@gw-instruments.de |
| D-13355 Berlin / Germany |
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Bluez-devel] Concurrency / Multi processing questions
2006-10-30 12:45 ` Peter Wippich
@ 2006-10-30 12:57 ` Marcel Holtmann
2006-10-30 13:09 ` Olivier Le Pogam
0 siblings, 1 reply; 7+ messages in thread
From: Marcel Holtmann @ 2006-10-30 12:57 UTC (permalink / raw)
To: BlueZ development
Hi Peter,
> > > > I think having understood the main concepts of RFCOMM
> > > > connections (DLC, DLCI ...) however I really wonder about
> > > > multi processing (globally and in BlueZ specifically)
> > > >
> > > > - If I want to write a service (published in the SDP) for example
> > > > on channel 9, can I write a forking server (forking at each accept
> > > > so it can accept a new incoming connection from another
> > > > remote device while the first connection is being managed ?)
> > > > We assume we have only one bdaddr (bluetooth adaptor) in local
> > > >
> > > > I suppose it could lead to 2 concurrent connection tuples like these ones :
> > > > ( (local_bdaddr, channel 9) - (remote1_addr, channel9) )
> > > > ( (local_bdaddr, channel 9) - (remote2_addr, channel9) )
> > > >
> > > > Is it possible ? Without any conflicts ? I know on the local service
> > > > we would have the same DLCI for both sockets. In TCP it would be
> > > > possible with REUSEADDR, would it be the same here ?
> > >
> > > This would not be possible. You can only have have one connection on a
> > > single server channel number (SCN). This is not a problem of BlueZ but a
> > > general Bluetooth issue. It may be possible to change the bluetooth stack
> > > in a way which will support a scenario aas described above, but I think
> > > this won't be a trivial task. And I'm not sure if it will still comply to
> > > the standard.
> >
> > actually this works perfectly fine. On each ACL link between two devices
> > you have 30 RFCOMM channels in one direction and another 30 in the other
> > direction. All RFCOMM restrictions are per ACL link.
>
> Ok, I think I've to get into this a little bit deeper. I think it's right
> that the RFC restrictions in general are per ACL link (or more precise per
> multiplexer session). On the other hand you can only have one
> listening session on a single SCN at a time. This means you have to fork a
> new listener once a session is started, right ?
that is how sockets work. You call listen() to create the actual
listener and then accept() for every connection. You can't have two
different listener that wanna listen on the same RFCOMM channel, but
that is also true for TCP/IP.
However you can bind one listener to BDADDR_ANY and the other one to the
actual address of the local dongle, but in that case the listener bound
to the local address always wins.
Regards
Marcel
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Bluez-devel] Concurrency / Multi processing questions
2006-10-30 12:57 ` Marcel Holtmann
@ 2006-10-30 13:09 ` Olivier Le Pogam
0 siblings, 0 replies; 7+ messages in thread
From: Olivier Le Pogam @ 2006-10-30 13:09 UTC (permalink / raw)
To: BlueZ development
Hi Marcel,
> that is how sockets work. You call listen() to create the actual
> listener and then accept() for every connection. You can't have two
> different listener that wanna listen on the same RFCOMM channel, but
> that is also true for TCP/IP.
>
> However you can bind one listener to BDADDR_ANY and the other one to the
> actual address of the local dongle, but in that case the listener bound
> to the local address always wins.
That's quite similar to TCP server sockets indeed, my concern is about
channels
reusing in a RFCOMM Service (which is always providing a service on channel
14
for example). Just wondering if there is something similar to SO_REUSEADDR,
implicitly, or explicitly, so that a Service can concurrently have several
clients on the
same bluetooth adaptor with read/write operations. And of course, there is
only
one listen() per adaptator, the fork() is done only for the IO processing
part.
Does someone know ?
Oli
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.408 / Virus Database: 268.13.17/505 - Release Date: 27/10/2006
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2006-10-30 13:09 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-27 20:50 [Bluez-devel] Concurrency / Multi processing questions Olivier Le Pogam
2006-10-29 14:25 ` Peter Wippich
2006-10-29 19:52 ` Olivier Le Pogam
2006-10-29 20:00 ` Marcel Holtmann
2006-10-30 12:45 ` Peter Wippich
2006-10-30 12:57 ` Marcel Holtmann
2006-10-30 13:09 ` Olivier Le Pogam
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox