rethicus
Posts: 7
Joined: Thu Sep 18, 2008 10:58 pm

Service lookup Timeout for a while

Fri Sep 19, 2008 12:36 am

Hi,

im trying to make a multi-threading app that connect to unknown devices using OBEXObjectPush. This app is sending info every x seconds. The problem occurrs sometimes for a long period of time, the DiscoverServices message throws a "Service lookup Timeout" exception, maybe six times, once or always.

question number 2, its possible to change the timeout for ServiceDiscovery?

This is a piece of the code (The service discover code):

try
{
services = device.DiscoverServices(ServiceType.OBEXObjectPush);

if (services.Length > 0)
{
service = (RemoteService)services[0];

fileStream = new FileStream(...);

newPush = new ObexObjectPush(-1);
newPush.PushFile(fileStream, fileName, service.Stream);
}
}
catch (Exception e)
{
...
}
finally
{

if( service != null )
service.Stream.Close();
}


Thank you!
Nicolas.



Edit:
using: Using Windows Vista, Widcomm bluetooth device and my target is a cellphone

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: Service lookup Timeout for a while

Fri Sep 19, 2008 10:48 am

What is question #1? why it happens? It can be anything, too much "background noise" from bluetooth signals bouncing all over the place. The stack on the device (or your computer) becomes unstable (happens a lot with Widcomm).
As for question #2, no, it's not possible to change the timeout.

Regards,
Jonas

Return to “BlueTools”