private void Initialize(string name, int listenPort, CommunicationTypes communicationType)
        {
            this.name            = name;
            this.clientInstances = new Dictionary <string, MonoExpanderInstance>();
            this.typeCache       = new Dictionary <string, Type>();

            switch (communicationType)
            {
            case CommunicationTypes.SignalR:
                throw new NotImplementedException();
                //this.serverCommunication = new ExpanderCommunication.SignalRServer(
                //    listenPort: listenPort,
                //    dataReceivedAction: DataReceived);
                break;

            case CommunicationTypes.Netty:
                this.serverCommunication = new ExpanderCommunication.NettyServer(
                    logger: this.log,
                    listenPort: listenPort,
                    dataReceivedAction: DataReceived,
                    clientConnectedAction: ClientConnected);
                break;

            default:
                throw new ArgumentException("Communication Type");
            }

            Executor.Current.Register(this);
        }
示例#2
0
        private void Initialize(string name, int listenPort, CommunicationTypes communicationType)
        {
            this.name = name;
            this.clientInstances = new Dictionary<string, MonoExpanderInstance>();
            this.typeCache = new Dictionary<string, Type>();

            switch (communicationType)
            {
                case CommunicationTypes.SignalR:
                    this.serverCommunication = new ExpanderCommunication.SignalRServer(
                        listenPort: listenPort,
                        dataReceivedAction: DataReceived);
                    break;

                case CommunicationTypes.Netty:
                    this.serverCommunication = new ExpanderCommunication.NettyServer(
                        listenPort: listenPort,
                        dataReceivedAction: DataReceived,
                        clientConnectedAction: ClientConnected);
                    break;

                default:
                    throw new ArgumentException("Communication Type");
            }

            Executor.Current.Register(this);
        }