与其它SuperSocket程序相同,启动代码同样也要写到程序的入口处,如 Windows Azure 的 WorkRole 项目的OnStart() 方法:

public override bool OnStart()

{

// Set the maximum number of concurrent connections

ServicePointManager.DefaultConnectionLimit = 100;

// For information on handling configuration changes

// see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.

m_Bootstrap = BootstrapFactory.CreateBootstrap();

if (!m_Bootstrap.Initialize())

{

Trace.WriteLine("Failed to initialize SuperSocket!", "Error");

return false;

}

var result = m_Bootstrap.Start();

switch (result)

{

case (StartResult.None):

Trace.WriteLine("No server is configured, please check you configuration!");

return false;

case (StartResult.Success):

Trace.WriteLine("The server has been started!");

break;

case (StartResult.Failed):

Trace.WriteLine("Failed to start SuperSocket server! Please check error log for more information!");

return false;

case (StartResult.PartialSuccess):

Trace.WriteLine("Some server instances were started successfully, but the others failed to start! Please check error log for more information!");

break;

}

return base.OnStart();

}

最新文章

  1. 张小龙微信小程序演讲内容简介
  2. java模拟开锁
  3. linux实践——简单程序破解
  4. haproxy实现负载均衡
  5. oracle 空表无法导出
  6. Redis Cluster架构和设计机制简单介绍
  7. [改善Java代码]使用package-info类为包服务
  8. Codeforces Round #198 (Div. 2) —— C
  9. selenium 学习笔记 ---新手学习记录(10) 问题总结(java)--poi--excel 操作
  10. MEF初体验之四:Imports声明
  11. Vuex(一)——vuejs的状态管理模式
  12. 动态读取文件持续显示在UI上
  13. 第二次项目冲刺(Beta阶段)--第七天
  14. Spring Boot 2.0(六):使用 Docker 部署 Spring Boot 开源软件云收藏
  15. MySQL 数据库设计总结
  16. 【Redis篇】初始Redis与Redis安装
  17. Jenkins官方社区携手灵雀云成功举办Jenkins Meetup
  18. 编译linux内核以及添加系统调用的全过程
  19. .NET Unity XML 配置文件(2)
  20. Google自动广告,将广告代码放置在 HTML 中的什么位置?

热门文章

  1. 2018-2-13-wpf-如何使用-Magick.NET-播放-gif-图片
  2. Android的ADB学习笔记
  3. 使用log4j打印日志
  4. androidstudio如何用github多人开发
  5. web前端学习(三)css学习笔记部分(10)-- 初级开发工程师面试题
  6. android中的http框架,使其更加简单易用
  7. Hdu 3603
  8. 双系统删除ubuntu
  9. OpenLayers添加和删除控件
  10. 【JZOJ3297】【SDOI2013】逃考(escape)