添加SuperSocket的启动代码到 Windows Azure 的 WorkRole 项目
与其它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();
}
添加SuperSocket的启动代码到 Windows Azure 的 WorkRole 项目的更多相关文章
- 在 Visual Studio 2010 中开发和部署 Windows Azure 应用程序
原文 在 Visual Studio 2010 中开发和部署 Windows Azure 应用程序 在 Visual Studio 2010 中开发和部署 Windows Azure 应用程序 Jim ...
- Windows Azure入门教学系列 (八):使用Windows Azure Drive
我们知道,由于云端的特殊性,通常情况下,对文件系统的读写建议使用Blob Storage来代替.这就产生了一个问题:对于一个已经写好的本地应用程序,其中使用了NTFS API对本地文件系统读写的代码是 ...
- Windows Azure一些小技巧集合
我最近做了一个Windows Azure上面的项目,自己在做的过程中遇到了很多问题.有的是我自己摸索解决,有的是到网上寻找零碎的信息结合起来解决的.我感觉应当把某些解决方法集中一下,方便我以后查阅,也 ...
- 最全的Windows Azure学习教程汇总
Windows Azure 是微软基于云计算的操作系统,能够为开发者提供一个平台,帮助开发可运行在云服务器.数据中心.Web 和 PC 上的应用程序. Azure 是一种灵活和支持互操作的平台,能够将 ...
- Windows Azure 社区新闻综述(#73 版)
欢迎查看最新版本的每周综述,其中包含有关云计算和 Windows Azure的社区推动新闻.内容和对话. 以下是过去一周基于您的反馈汇集在一起的内容: 文章.视频和博客文章 · Windows A ...
- Windows Azure 微软公有云体验(二) 存储成本比较分析
Windows Azure 微软公有云已经登陆中国有一段时间了,现在是处于试用阶段,Windows Azure的使用将会给管理信息系统的开发.运行.维护带来什么样的新体验呢? Windows Azur ...
- 年末促销 Windows Azure在线充值送微软商城硬件大礼包
春节前充值,尽享云端体验, 缤纷好礼持续进行时.即日起至2015年2月13日, 充值1000元以上即享好礼.您可以查阅WindowsAzure 官网活动页面,即刻参与活动:http://www.win ...
- [SDK2.2]Windows Azure Storage (15) 使用WCF服务,将本地图片上传至Azure Storage (上) 服务器端代码
<Windows Azure Platform 系列文章目录> 这几天工作上的内容,把项目文件和源代码拿出来给大家分享下. 源代码下载:Part1 Part2 Part3 我们在写WEB服 ...
- [SDK2.2]Windows Azure Storage (16) 使用WCF服务,将本地图片上传至Azure Storage (上) 客户端代码
<Windows Azure Platform 系列文章目录> 前一章我们完成了服务器端的代码,并且已经发布到了Windows Azure云端. 本章我们将实现客户端的代码,客户端这里我们 ...
随机推荐
- placeholder改变输入框字体颜色
::-webkit-input-placeholder { color: #888;}:-moz-placeholder { color: #888;}::-moz-placeholder{col ...
- mysql各个引擎区别
1.如果你有一个 MyISAM 数据表包含着 FULLTEXT 或 SPATIAL 索引,你将不能把它转换为使用 另一种引擎,因为只有 MyISAM 支持这两种索引. 2. 如果你有一个数据表包含着一 ...
- 重磅发布:阿里开源 Open JDK 长期支持版本 Alibaba Dragonwell
3 月 21 日北京阿里云峰会,阿里巴巴正式宣布对外开源 OpenJDK 长期支持版本 Alibaba Dragonwell.作为 Java 全球管理组织 Java Community Process ...
- vagrant up 时提示错误 cound not open file
根据教程:https://laravel-china.org/docs/laravel-development-environment/5.5/development-environment-wind ...
- PyCharm 头文件设置及作用
PyCharm 头文件 设置 进入File --->settings---->Editor---->File and Code Templates----->Python Sc ...
- Spark day05
Shark Shark是基于Spark计算框架之上且兼容Hive语法的SQL执行引擎,由于底层的计算采用了Spark,性能比MapReduce的Hive普遍快2倍以上,当数据全部load在内存的话,将 ...
- 在一台机器上搭建多个redis实例
默认Redis程序安装在/usr/local/redis目录下: 配置文件:/usr/local/redis/redis.conf,该配置文件中配置的端口为默认端口:6379: Redis的启动命令路 ...
- day18 jQuery,JavaScript高级&Django
回顾: 整体: - HTML - CSS - JavaScript:基本数据类型:流程控制语句 - DOM - BOM:setInterval() - jQuery - 选择器 - 筛选器 - 内容和 ...
- 我的iOS高效编程秘诀—坚持编程习惯
http://www.cocoachina.com/programmer/20150819/13103.html 作者:sunljz 授权本站转载. 习惯会影响一个人做事的方式,也会直接影响效率.我经 ...
- python 自主控制异常:用户自定义异常