[文章作者:张宴 本文版本:v1.0 最后修改:2011.06.28 转载请注明原文链接:http://blog.zyan.cc/windows_mstsc/]

  个人不喜欢服务端程序,以 Windows 操作系统作为运行平台,但是,很多时候,迫于环境现状,需要让自己的程序实现跨平台。

  在开发全新的金山游戏运营平台时,发现:虽然大部分游戏,服务端程序运行在 Linux 服务器,但是,仍有例外。几款最近代理的游戏,服务端运行在 Windows 服务器上。西山居开发的游戏,服务端集群架构,既有 Windows 服务器,又有 Linux 服务器。

  点击在新窗口中浏览此图片


  游戏运行系统的 Knose 程序,我最初是在 Linux 下开发的,后来才实现了兼容 Windows 的跨平台版本。

  点击在新窗口中浏览此图片


  在 Linux 下,Knose 为“父子进程+指令处理线程池+独立功能多线程”结构;在 Windows 上,将 Knose 父子进程结构,拆分成了 knose_daemon.exe(Service 服务程序)和 knose.exe(主程序),由 knose_daemon.exe 启动 knose.exe。

  点击在新窗口中浏览此图片


  遇到了问题:按照运营维护需求,knose.exe 以及通过它启动的游戏服务端进程,需要有“窗口界面”,显示在桌面中。而 knose_daemon.exe 是以服务方式运行的,无窗口界面,knose_daemon.exe 启动的 knose.exe,窗口界面没有弹出来。

  为了解决这个问题,我在 install.bat 中,用了 Windows 的 sc 命令,将 knose_daemon.exe 启动为系统服务,“type= interact type= own”设置了“允许桌面与服务交互”。在本机(Windows XP SP3)测试,knose.exe 的窗口界面以及通过它启动的游戏进程窗口界面,都弹出来了。

@echo off
sc create "KingeyesKnose" binPath= "%CD%\knose_daemon.exe" DisplayName= "Kingeyes Knose Daemon" start= auto type= interact type= own
sc description KingeyesKnose "金山游戏运营系统 KingEyes Knose 守护进程。"
sc start KingeyesKnose


  点击在新窗口中浏览此图片


  于是将程序发布到 Windows Server 2003 服务器上,远程桌面连接上去,发现 knose.exe 的窗口界面始终弹不出来。

  后来,同事发现,原来是“远程桌面”惹的祸:

  远程桌面客户端 mstsc 有一个 /console 参数,模式等同于本地终端显示器登录,/console 不会去占用非 /console 远程桌面,远程桌面允许两个正常连接和一个控制台/console方式连接,并且正常连接和 /console 连接的桌面操作不能相互看见,只有通过 /console 参数远程桌面连接到 Windows 2003 服务器,才能够看到弹出的 knose.exe 窗口界面。

  在 Windows XP SP3 以上版本,/console 参数改名为 /admin,需要用 mstsc /admin 启动远程桌面:

  点击在新窗口中浏览此图片

  连上后,终于能够看到由 knose_daemon.exe 启动的 knose.exe 程序窗口,以及由 knose.exe 启动的游戏服务端进程窗口了。





技术大类 » Windows相关 | 评论(70) | 引用(0) | 阅读(63599)
Abercrombie Email Homepage
2012-5-9 10:35
Les entreprises au sein de la rue ou d'une localité peut-être pas assez de produits disponibles pour s'assurer que l'assortiment sera selon toute probabilité, être limité.Ne pas éliminer souhaitez puisque vous y trouverez des magasins Abercrombie pour le net qui vous offrent l'acquisition d'un montant global de l'assortiment même si dans l'intérieur de la veste Abercrombie long créant utilisation d'un autre genre de vêtements Abercrombie achat. Cependant, ne pas assumer tous les nous sont très standard et de détente à l'achat en ligne.
Hogan Email Homepage
2012-5-10 17:45
Ci sono diversi motivi principali per cui si può sicuramente trovare sul proprio volere le soluzioni contabili che coinvolgono tutta Stansted, anche se alcune persone potrebbero uomini e donne, probabilmente si dovrà disporre di soluzioni contabili rispetto con la gente. Stai con me per scoprire di più su molti dei motivi per prendere in considerazione l'impiego contabili in tutta Hogan Stansted. Costruire un businessIf vi capita di essere in funzione, è abbastanza possibile che si può fare uso di soluzioni contabili. Non date per scontato tutte le società hanno abbastanza soldi per utilizzare a tempo pieno il personale fiscali, così utilizzando una conditi insieme con l'agenzia affidabile che coinvolge tutta commercialisti Stansted potrebbe rendere meno difficili problemi.
hogan280 Email
2012-5-10 18:00
Focalizzando l'attenzione sull'elemento gara di questo reato - qualcosa suscitato dal comportamento oltraggioso della Difesa League inglese e BNP al di fuori del tribunale di Liverpool - è facile perdere di vista il fatto che Hogan questo è un racconto ampio di abuso e non è univoco ad una comunità. Marai Larasi, direttore della Imkaan e co-presidente del End Violence Against Women Coalition, avverte: "Una eccessiva attenzione su alcuni casi di sfruttamento sessuale con una concentrazione di etnie, piuttosto che lo sfruttamento della stessa è fuorviante e gli atteggiamenti razzisti dei combustibili che in ultima analisinon aiuta le donne e le ragazze. "
Louis Vuitton Speedy Email Homepage
2012-5-19 21:06
www.lvbagclassic.com are authorized authentic Louis Vuitton handbags outlet store. All the items at our site are 100% authentic. All our Louis Vuitton handbags will come with the authenticity card, serial Number, dust bag and care booklet. We promise you will be 100% satisfied when you get such cheap authentic Louis Vuitton handbags from us!
Louis Vuitton Neverfull|Louis Vuitton Speedy|Louis Vuitton Alma|Louis Vuitton Artsy
Louis Vuitton Neverfull Email Homepage
2012-5-19 21:06
We are authorized authentic Louis Vuitton handbags outlet store. All the items at our site are 100% authentic. All our Louis Vuitton handbags will come with the authenticity card, serial Number, dust bag and care booklet. We promise you will be 100% satisfied when you get such cheap authentic Louis Vuitton handbags from us! For more information, please visit http://www.authenticlouisvuittonpurses.com/.
cxf0401
2012-6-11 10:34
Michael Kors handbags outlet Bundled in the assortment are white mink Michael Kors handbags sporting chain handles in gleaming silver and the chocolate viscose tote with rabbit trim. Welcome to our online sales shop, where you can always buy the most affordable price to a your favorite Michael Kors outlet.
Vivienne Westwood Jewellery Email Homepage
2012-6-11 23:34
<p>Vivienne Westwood would be christened Vivienne Swire the first place yet turned upward working in your young village working in Derbyshire without you're going utes with your yourselves your friends yet wasting your word you will have to what to wear within exhaust university yes Art. within your young way  <strong>vivienne westwood bags</strong>  out your day works university she witnessed themselves whilst what are the university tutor within your wide variety  <strong>Vivienne Westwood Jewellery</strong>  yes university working in Brixton, yet wouldn't to reduce yourselves worry about yes works yet fashion, whilst she written yet  <strong>vivienne westwood sale</strong>  sold jewelery within Portobello way Market. ,Look more related about <strong>Vivienne Westwood Jewellery</strong>:http://www.ukviviennewestwoodhandbags.com/ </br></p>
cheap designer sunglasses
2012-6-29 15:18
If you want a high quality pair of cheap sunglasses, Designer wholesale sunglasses are your best options. You now have the opportunity to select from one of our many wholesale sunglasses.These sunglasses are the highest in quality and fashion.If you are looking for the hottest new sunglass styles please visit our wholesale designer sunglasses web site and let us show you why we are the industries leader!
Celine handbags Email Homepage
2012-7-2 16:08
Celine handbags,
Women handbag is state right into a lot of women who wear them.
Celine bag,
With regards to cheap Celine women's handbags, you will find endless solutions.
Celine luggage tote,
These women handbag varieties may be the dream of work in general and then any type of company meetings.
Oakley vault Email Homepage
2012-7-2 16:13
When the term sunglasses come up in any conversation, it is generally very quickly followed by the brand name of Oakley Vault. They have been one of the leading manufacturers of Oakley Sunglasses for years and they are by far the most popular brand that is sought after on Oakleyvault20l2.com today.
coachoutlet Email Homepage
2012-8-5 21:43
coach outlet online http://www.coachoutlets2u.org/.
likewise Email Homepage
2012-10-30 11:52
Likewise,Coach Outlet Mr. Ryan, whASD
Coach Email Homepage
2012-11-3 14:49
"The Coach Outletengines that will likely power the J-31 we do know a bit mor.Coach Outlet  Those engines were actually revealed at the Zhuhai showCoach Outlet in 2008," Fisher said referring to an annual China air show. He beCoach Outletlieves the new J-31 engine is undergoing preliminary
本地兼职MM上门 Homepage
2013-5-7 19:16
海阔天空俏佳人时尚娱乐会所【15026982229】在全国主要城市均设有连锁店,就近提供北京,上海,广州,西安,重庆,杭州,温州,南京....本地兼职MM上门保健按摩。网址:www.lvcai.org
www.400-0476.com Email Homepage
2014-6-25 14:00
www.400-0476.com
省电百科 Homepage
2014-11-3 15:40
安卓手机提高续航能力,一键省电-省电大百科http://www.sddashi.com/baike省电大百科
cping Email Homepage
2015-2-25 22:43
盼望回访小站http://www.xrpmoon.com/blog
Steven Email Homepage
2015-3-19 02:22
Thank you for this post Weight Loss Tea
steven Email Homepage
2015-3-20 05:31
分页: 3/4 第一页 上页 1 2 3 4 下页 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]