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


C# Server.Initialize方法代码示例

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


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

示例1: Manager

        public Manager(Configuration configuration, Action<string> outputText)
        {
            Log.InitializeOutputSource(outputText, Path.Combine(configuration.StoragePath, "log.txt"));

            m_configuration = configuration;

            m_server = new Server();
            m_info = new AppInfo(m_server, m_configuration);

            m_server.Initialize(m_info);

            m_features = new Dictionary<FeatureType, Feature>();

            // Initialize features; we should have a better factory for this; any new features should be added here.
            m_features.Add(FeatureType.Contact, new Features.ContactFeature(m_info));
            m_features.Add(FeatureType.Company, new Features.CompanyFeature(m_info));
            m_features.Add(FeatureType.List, new Features.ListFeature(m_info));
            m_features.Add(FeatureType.ListMembership, new Features.ListMembershipFeature(m_info));
            m_features.Add(FeatureType.Workflow, new Features.WorkflowFeature(m_info));
            m_features.Add(FeatureType.WorkflowEnrollment, new Features.WorkflowEnrollmentFeature(m_info));
            m_features.Add(FeatureType.ContactProperty, new Features.ContactPropertyFeature(m_info));
            m_features.Add(FeatureType.CompanyProperty, new Features.CompanyPropertyFeature(m_info));
            m_features.Add(FeatureType.ContactPropertyGroup, new Features.SingleCallFeature(m_info, FeatureType.ContactPropertyGroup, "contacts/v2/groups"));
            m_features.Add(FeatureType.CompanyPropertyGroup, new Features.SingleCallFeature(m_info, FeatureType.CompanyPropertyGroup, "companies/v2/groups"));
            m_features.Add(FeatureType.Form, new Features.FormFeature(m_info));
            m_features.Add(FeatureType.CalendarEvent, new Features.CalendarEventFeature(m_info));
        }
开发者ID:bizx,项目名称:HubSpotSync,代码行数:27,代码来源:Manager.cs

示例2: Main

        static void Main(string[] args)
        {
            Trace.Listeners.Add(new ConsoleTraceListener());
            try
            {
                const int maxConnection = 10;
                const int receiveBufferSize = 4096;
                const int port = 1337;

                using (Server server = new Server(maxConnection, receiveBufferSize))
                {
                    IPEndPoint endpoint = new IPEndPoint(IPAddress.Loopback, port);
                    server.Initialize();
                    server.Start(endpoint);
                    System.Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                Trace.WriteLine(ex.Message);
            }
        }
开发者ID:Daimakaicho,项目名称:TSIO,代码行数:22,代码来源:Program.cs


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