.NET Components for Mobility

BluetoothClient exceptions

Last post 05-23-2007 11:39 AM by dariosalvi. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 05-22-2007 12:16 PM

    BluetoothClient exceptions

    Hi,

    I'm trying to connect to a device with the BluetoothClient.Connect().

    It works only once each 5/6 times.

    I can't debug the reason because the only information I get from the exception is: 

    InTheHand.Net.Sockets.BluetoothClient

     

    Could someone help me please??

     

    Dario 

  • 05-22-2007 4:26 PM In reply to

    Re: BluetoothClient exceptions

    Well if I remember correctly you're developing for NETCF; exception information is somewhat less there, but you should at least be told the exception type, SocketException, or ArgumentException etc.  Are you debugging from within VS?  If not, to see the exception message too then see http://blogs.msdn.com/netcfteam/archive/2004/08/06/210232.aspx

    Anyway if its a SocketException you want to look at the ErrorCode property.  If you can't see it in VS, then catch it in your code and display the value yourself.

    Alan J. McFarlane
    http://www.alanjmcf.me.uk/
    Please follow-up in the newsgroup for the benefit of all.
    Have I helped? Consider visiting my Amazon wishlist, see my homepage.
  • 05-23-2007 11:39 AM In reply to

    Re: BluetoothClient exceptions

    I finally used the socket.Connect() function (I looked at the client.Connect() code and it does the same)

    I am getting this kind of Exception very often:

    No connection could be made because the target machine actively refused it

     

    Now I am trying to connect to two kinds of devices:

    A Windows XP computer:  and in this case it works fine, it always connects.

    An electronic device: and in this case it connects one time every 6 or 7.

    The strange thing is that if I use the normal WindowsCE serial port emulation it works always. I mean that if I associate the device to a virtual serial port, and then access the serial port (not taking into account BT, just a serial port access) the connection works fine. I guess there's some problem when I am using the connect call, is there any way I can debug this better?

    Any idea?

     

    Thanks very much.

     

    Dario 

    Filed under: ,
Page 1 of 1 (3 items)
Copyright © 2001-2008 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy.