当前位置: 首页>>代码示例>>C#>>正文


C# IServer.Listen方法代码示例

本文整理汇总了C#中IServer.Listen方法的典型用法代码示例。如果您正苦于以下问题:C# IServer.Listen方法的具体用法?C# IServer.Listen怎么用?C# IServer.Listen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IServer的用法示例。


在下文中一共展示了IServer.Listen方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Start

        public void Start()
        {
            _scheduler = KayakScheduler.Factory.Create(new SchedulerDelegate());
            _server = KayakServer.Factory.CreateHttp(new RequestDelegate(Port, Title, FilePaths, ImagePath), _scheduler);

            _server.Listen(new IPEndPoint(IPAddress.Any, Port));
            _scheduler.Start();
        }
开发者ID:sakowiczm,项目名称:Audiobook-Feed-Builder,代码行数:8,代码来源:Server.cs

示例2: Start

        public void Start()
        {
            m_Scheduler = KayakScheduler.Factory.Create(new SchedulerDelegate());
            m_Server = KayakServer.Factory.CreateHttp(new NancyRequestDelegate(m_Engine), m_Scheduler);

            IDisposable disposable = m_Server.Listen(m_EndPoint);
            Thread schedulerWorkerThread = new Thread(SchedulerWorker);
            schedulerWorkerThread.IsBackground = true;
            schedulerWorkerThread.Start(disposable);
            m_Scheduler.Post(GetLocalPort);
        }
开发者ID:rmc47,项目名称:CloudlogCAT,代码行数:11,代码来源:HttpHost.cs

示例3: Run

        public void Run()
        {
            IsRunning = true;

            _messageManager = new MessageManager(Encryptor);

            try
            {
                _server = new ServerTcp(Address, Port, _messageManager);
                _server.NewClientEvent += ClientConnected_EventHandler;
                RunConnectionCheckTask();
                _server.Listen();
            }
            catch (SocketException e)
            {
                StopRunning();
                throw;
            }
        }
开发者ID:ionhristiniuc,项目名称:chatapp,代码行数:19,代码来源:NotificationServer.cs

示例4: _SetServerEnableState

        private void _SetServerEnableState(bool value, int port)
        {
            if (value) {
                if (server != null) _SetServerEnableState(false, port);

                server = KayakServer.Factory.CreateHttp(new RequestDelegate(), scheduler);
                server.Listen(new IPEndPoint(IPAddress.Any, port));
                LiveSystemContext = VixenSystem.Contexts.GetSystemLiveContext();

                Thread T = new Thread(new ThreadStart(scheduler.Start));
                T.Start();
            } else {
                scheduler.Stop();
                if (server != null) {
                    server.Dispose();
                    server = null;
                }
                LiveSystemContext = null;
            }
        }
开发者ID:Jchuchla,项目名称:vixen,代码行数:20,代码来源:Module.cs

示例5: RunApplication

        public void RunApplication(int port, Action<FubuRuntime> activation)
        {
            _port = port;

            _listeningEndpoint = new IPEndPoint(IPAddress.Any, _port);
            Console.WriteLine("Listening on " + _listeningEndpoint);

            _applicationDelegate = AppBuilder.BuildConfiguration(x => x.RescheduleCallbacks().Run(ExecuteRequest));

            _scheduler = KayakScheduler.Factory.Create(_schedulerDelegate);
            _server = KayakServer.Factory.CreateGate(_applicationDelegate, _scheduler, null);

            if (_listeningEndpoint == null)
            {
                throw new InvalidOperationException("Start() can only be called after RunApplication() and Stop()");
            }

            var runtime = rebuildFubuMVCApplication();

            _kayakListenerDisposer = _server.Listen(_listeningEndpoint);
                _scheduler.Post(() => ThreadPool.QueueUserWorkItem(o => activation(runtime)));
                _scheduler.Start();
        }
开发者ID:DRHouk,项目名称:fubumvc,代码行数:23,代码来源:FubuOwinHost.cs

示例6: _SetServerEnableState

        private void _SetServerEnableState(bool value, int port)
        {
            if (value) {
                if (server != null) _SetServerEnableState(false, port);

                server = KayakServer.Factory.CreateHttp(new RequestDelegate(), scheduler);
                server.Listen(new IPEndPoint(IPAddress.Any, port));
                LiveContext = VixenSystem.Contexts.CreateLiveContext("Web Server");
                LiveContext.Start();
                Thread T = new Thread(new ThreadStart(scheduler.Start));
                T.Start();
            } else {
                scheduler.Stop();
                if (server != null) {
                    server.Dispose();
                    server = null;
                }
                if (LiveContext != null)
                {
                    //We are the only current consumer of LiveContext, so shut it off when we are done.
                    VixenSystem.Contexts.ReleaseContext(LiveContext);
                    LiveContext = null;
                }
            }
        }
开发者ID:komby,项目名称:vixen,代码行数:25,代码来源:Module.cs


注:本文中的IServer.Listen方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。