Пример #1
0
        //----
        protected override CommonRfcommStream GetNewPort()
        {
            var set     = _portSettings.Dequeue();
            var command = new LsnrCommands();

            switch (set)
            {
            case LsnrSetting.None:
                break;

            case LsnrSetting.ErrorOnOpenServer:
                command.NextOpenServerShouldFail = true;
                break;

            case LsnrSetting.ConnectsImmediately:
                command.NextPortShouldConnectImmediately = true;
                break;

            case LsnrSetting.ErrorConnectsImmediately:
                throw new NotImplementedException();

            //  break;
            default:
                throw new ArgumentException("Unknown LsnrSetting value: " + set);
            }
            return(new NullRfcommStream(command));
        }
Пример #2
0
        public LsnrCommands Clone()
        {
            var copy = new LsnrCommands
            {
                NextPortShouldConnectImmediately = this.NextPortShouldConnectImmediately,
                NextOpenServerShouldFail         = this.NextOpenServerShouldFail
            };

            return(copy);
        }
Пример #3
0
 internal NullRfcommStream(LsnrCommands cmds)
 {
     _cmds = cmds;
 }