Exemplo n.º 1
0
        private ObexListener(ObexTransport transport, BluetoothPublicFactory factory)
        {
#if NETCF
            PlatformVerification.ThrowException();
#endif
            _btFactory = factory;
            switch (transport)
            {
            case ObexTransport.Bluetooth:
                ServiceRecord record = CreateServiceRecord();
                if (_btFactory == null)
                {
                    bListener = new BluetoothListener(BluetoothService.ObexObjectPush, record);
                }
                else
                {
                    bListener = _btFactory.CreateBluetoothListener(BluetoothService.ObexObjectPush, record);
                }
                bListener.ServiceClass = ServiceClass.ObjectTransfer;
                break;

            case ObexTransport.IrDA:
#if NO_IRDA
                throw new NotSupportedException("No IrDA on this platform.");
#else
                iListener = new IrDAListener("OBEX");
                break;
#endif
            case ObexTransport.Tcp:
                tListener = new TcpListener(IPAddress.Any, 650);
                break;

            default:
                throw new ArgumentException("Invalid transport specified");
            }
            this.transport = transport;
        }
Exemplo n.º 2
0
 // * Bluetooth Address and Path
 internal ObexWebRequest(string scheme, BluetoothAddress target, string path,
                         BluetoothPublicFactory factory)
     : this(CreateUrl(scheme, target, path), factory)
 {
 }
Exemplo n.º 3
0
 internal ObexWebRequest(Uri requestUri, BluetoothPublicFactory factory)
     : this(requestUri)
 {
     Debug.Assert(factory != null, "NOT factory!=null");
     _btFactory = factory;
 }
Exemplo n.º 4
0
 internal ObexListener(BluetoothPublicFactory factory)
     : this(ObexTransport.Bluetooth, factory)
 {
     Debug.Assert(factory != null, "NOT factory!=null");
     Debug.Assert(factory == _btFactory, "_btFactory NOT set correctly in other .ctor");
 }