Obex on Windows

59 views
Skip to first unread message

Simo

unread,
Jul 3, 2009, 10:37:43 AM7/3/09
to bluecove-users
Hello,
I want send a file to more than one device (max 6 at the same time)
using Obex.

I've readed the Multiple adapters vs. multiple threads

(http://groups.google.com/group/bluecove-users/browse_thread/thread/
2fcaa54d0a27d72d/67da3a5c453fc0c7?show_docid=67da3a5c453f

c0c7), but i want use only one Adapter (I have used the same class of
this link changed for one adapter).
After device and search discover (UUID(0x1105)) i want send one file
to more devices. I use a thread for each device!

I use Windows XP SP2 (or Vista Home), winsock stack, bluecove-2.1.0.

The program crash and i have this output:

running SenderThread Thread-1 on device 0
bluetooth.connected.devices.max= 7
running Send2DeviceThread Thread-2 on device 0
Sending from Thread-2 to btgoep://001F6BE8C89E:9;authenticate=false;encrypt=false;master=false
running Send2DeviceThread Thread-3 on device 0
Sending from Thread-3 to btgoep://001A8A9B3AEC:7;authenticate=false;encrypt=false;master=false
Sending from Thread-2 to btgoep://001F6BE8C89E:9;authenticate=false;encrypt=false;master=false
... done: -2
javax.bluetooth.BluetoothConnectionException: Failed to connect;
[10058] Socket chiuso nella direzione specificata da una

precedente chiamata di arresto. Richiesta di invio o ricezione dati
annullata.
at com.intel.bluetooth.BluetoothStackMicrosoft.connect(Native
Method)
at com.intel.bluetooth.BluetoothStackMicrosoft.access$700
(BluetoothStackMicrosoft.java:44)
at com.intel.bluetooth.BluetoothStackMicrosoft
$ConnectThread.run(BluetoothStackMicrosoft.java:651)
Cant open connection -2
Sending from Thread-3 to btgoep://001A8A9B3AEC:7;authenticate=false;encrypt=false;master=false
... done: 0


What'is the problem, the stack or Windows?
I try with BlueSoleil driver but i have problem.
Can I try with an adapter with widcomm stack or i will have the same
problem?


Help me! I'm desperate

Vlad Skarzhevskyy

unread,
Jul 3, 2009, 10:50:30 AM7/3/09
to bluecov...@googlegroups.com
All should work with MS and widcomm stack.
Don't even try BlueSoleil it will not work.

Can you create at least one connection to discovered devices?

Vlad

Simo

unread,
Jul 3, 2009, 11:42:59 AM7/3/09
to bluecove-users
I have a thread that finds device and search OBEX Push. When this
thread finish, i start the threadS for send file (one thread for each
URL founded).

All works correctly if i start one thread at a time. The thread send
file to one device; when this threat finish, i start the second thread
that send the file to the second device... and so on

But if i start for example 2 thread at the same time (the first thread
send file to one device and the second at the second device) the
program crash!

Do you succeed to send one file to more devices at the same time using
XP (or Vista) and WINSOCK?
(if i invoke BlueCoveImpl.getThreadBluetoothStackID() i have
"WINSOCK"

Thanks a lot
Simo

Vlad Skarzhevskyy

unread,
Jul 3, 2009, 12:47:19 PM7/3/09
to bluecov...@googlegroups.com

The best I can sugest is to wait for connection established and only then start the second connection.

Why it is not working as you described needs investigation that takes allot of time. To start try the same app on linux and on widcomm. If it works then it is MS to blame..........

Vlad

On Jul 3, 2009 11:43 AM, "Simo" <vito....@hotmail.it> wrote:


I have a thread that finds device and search OBEX Push. When this
thread finish, i start the threadS for send file (one thread for each
URL founded).

All works correctly if i start one thread at a time. The thread send
file to one device; when this threat finish, i start the second thread
that send the file to the second device... and so on

But if i start for example 2 thread at the same time (the first thread
send file to one device and the second at the second device) the
program crash!

Do you succeed to send one file to more devices at the same time using
XP (or Vista) and WINSOCK?
 (if i invoke BlueCoveImpl.getThreadBluetoothStackID() i have
"WINSOCK"

Thanks a lot
Simo

On 3 Lug, 16:50, Vlad Skarzhevskyy <skarzhevs...@gmail.com> wrote: > All should work with MS and w...

--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subs...

Simo

unread,
Jul 7, 2009, 2:13:13 PM7/7/09
to bluecove-users
With 2 phone i try to wait for connection established on first phone.
When the connection on the first phone is established, i start the
connection on the second phone:

//---------------------------
clientSession = (ClientSession) Connector.open(connectionURL);

System.out.println("HeaderSet hsConnectReply");
HeaderSet hsConnectReply = clientSession.connect(null) ;

if (hsConnectReply.getResponseCode() != ResponseCodes.OBEX_HTTP_OK)
{
System.out.println("Failed to connect");
return;
}

//In this point i can start the second thread
m_bConnectionStarted = true;

//-------------------------------------------------------------

The file is received on one phone but it isn't received on the other
phone!
There is an error : "java.io.EOFException: EOF while reading OBEX
packet"

What can i try now?

Can i try with this adapter on Linux or I must buy a new adapter with
WIDCOMM stack and try again on Windows?

Thanks a lot!!!









On 3 Lug, 18:47, Vlad Skarzhevskyy <skarzhevs...@gmail.com> wrote:
> The best I can sugest is to wait for connection established and only then
> start the second connection.
>
> Why it is not working as you described needs investigation that takes allot
> of time. To start try the same app on linux and on widcomm. If it works then
> it is MS to blame..........
>
> Vlad
>

Simo

unread,
Jul 29, 2009, 10:25:25 AM7/29/09
to bluecove-users
Hello,
I created a Virtual Machine with ubuntu 9.04, 512MB of RAM, bluez 4.32
version and so on...
I tested my software that now it sends a file to MORE than one device
at the same time !!!

It works then it is Micosoft and WINSOCK to blame!!!

But i have a problem! the transfer speed is very very low (about 1000
Byte/s)!
For the same file, the transfer time in Windows is about 6 sec but in
Linux is about 70 sec!!!!

What's the problem and How can i resolve this problem?
Sorry, but i'm not a guru of Linux.

Thanks a lot
Simo

PS: this problem also happens when i transfer a file without using
Bluecove (with ubuntu function)
> > message because you are subs...- Nascondi testo citato
>
> - Mostra testo citato -
Reply all
Reply to author
Forward
0 new messages