.NET Components for Mobility

Binding a listener to local socket

Last post 10-19-2007 11:11 AM by alanjmcf. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 10-18-2007 9:27 AM

    Binding a listener to local socket

    I am trying to bind to the local Endpoint to start a asynchronous listener using the following code but get the following error.

    The requested address is not valid in its context

    I have used other bluetooth functionality within the InTheHand framework so my BT dongle is compatible.. 

    What am I going wrong?

             BluetoothAddress BTAddress = BluetoothRadio.PrimaryRadio.LocalAddress;

             BluetoothEndPoint LocalEndPoint = new BluetoothEndPoint(BTAddress, _N2FServiceGUID, 100);

             BluetoothClient BTClient = new BluetoothClient();

            try
            {
                BTClient.Client.Bind(LocalEndPoint); <-- error occurs here
                BTClient.Client.Listen(100);

            }
     

  • 10-19-2007 11:11 AM In reply to

    Re: Binding a listener to local socket

    The maximum RFCOMM port/channel number is 31, so either remove the last argument (100) from the BluetoothEndPoint constructor entirely, or change it to something less than 31.

    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.
Page 1 of 1 (2 items)
Copyright © 2001-2008 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy.