﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>博客园-逸天阁-最新评论</title><link>http://www.cnblogs.com/kriss/CommentsRSS.aspx</link><description>击长空、博千里，笑慑鬼魅，坦荡万象。四海皆是可有作为，宇内必有余之归宿。</description><language>zh-cn</language><pubDate>Thu, 16 Oct 2008 10:10:03 GMT</pubDate><lastBuildDate>Thu, 16 Oct 2008 10:10:03 GMT</lastBuildDate><generator>cnblogs</generator><item><title>Re:WinForm中设计时与DesignMode的区别</title><link>http://www.cnblogs.com/kriss/archive/2010/03/26/112508.html#1787702</link><dc:creator>Tony Chi</dc:creator><author>Tony Chi</author><pubDate>Fri, 26 Mar 2010 04:04:47 GMT</pubDate><guid>http://www.cnblogs.com/kriss/archive/2010/03/26/112508.html#1787702</guid><description><![CDATA[[quote]StevenShi：if (!this.ParentForm.Site.DesignMode)
&lt;br/&gt;{
&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;}[/quote]

还需要增加ParentForm不为Null的验证<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/kriss/" target="_blank">Tony Chi</a> 2010-03-26 12:04 <a href="http://www.cnblogs.com/kriss/archive/2010/03/26/112508.html#1787702#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Re:Remoting多个信道(Chennel)的注册问题</title><link>http://www.cnblogs.com/kriss/archive/2010/02/10/288177.html#1763799</link><dc:creator>且行且思</dc:creator><author>且行且思</author><pubDate>Wed, 10 Feb 2010 01:17:47 GMT</pubDate><guid>http://www.cnblogs.com/kriss/archive/2010/02/10/288177.html#1763799</guid><description><![CDATA[BinaryServerFormatterSinkProvider serverSinkProvider = new BinaryServerFormatterSinkProvider();
            BinaryClientFormatterSinkProvider clientSinkProvider = new BinaryClientFormatterSinkProvider();
            serverSinkProvider.TypeFilterLevel = TypeFilterLevel.Full;
            IDictionary properties = new Hashtable();
            properties[&quot;port&quot;] = 0x1f97;
            TcpChannel chnl = new TcpChannel(properties, clientSinkProvider, serverSinkProvider);
            ChannelServices.RegisterChannel(chnl, false);
            try
            {
                RemotingConfiguration.RegisterWellKnownClientType(typeof(ClassCenterService), &quot;tcp://&quot; + this.strRemoteAddress + &quot;:9992/InfowiseTCPMS.ServiceData/Infowise.TCPMS.RemoteServiceLibrary.ClassCenterService&quot;);
                return true;
            }
            catch
            {
                return false;
            }

//***************************************
请教博主，这里二处的端口号必须一致么？？造成上面的TCP 信道协议冲突，是否源于这二处的端口号不一致决定的？？<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/kriss/" target="_blank">且行且思</a> 2010-02-10 09:17 <a href="http://www.cnblogs.com/kriss/archive/2010/02/10/288177.html#1763799#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Re:Remoting多个信道(Chennel)的注册问题</title><link>http://www.cnblogs.com/kriss/archive/2010/02/09/288177.html#1763713</link><dc:creator>且行且思</dc:creator><author>且行且思</author><pubDate>Tue, 09 Feb 2010 15:01:14 GMT</pubDate><guid>http://www.cnblogs.com/kriss/archive/2010/02/09/288177.html#1763713</guid><description><![CDATA[&lt;channel name=&quot;Channel1&quot; port=&quot;8186&quot; ref=&quot;tcp&quot;/&gt; 
      
  
Client代码： 
RemotingConfiguration.Configure( &quot;Client.exe.Config&quot; ); 
Share.TestClass test1 = (Share.TestClass) Activator.GetObject( 
    typeof( Share.TestClass ), &quot;tcp://localhost:8086/Test&quot; ); 


请教博主，这里二处的端口号必须一致么？？造成上面的TCP 信道协议冲突，是否源于这二处的端口号不一致决定的？？<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/kriss/" target="_blank">且行且思</a> 2010-02-09 23:01 <a href="http://www.cnblogs.com/kriss/archive/2010/02/09/288177.html#1763713#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Re:Remoting多个信道(Chennel)的注册问题</title><link>http://www.cnblogs.com/kriss/archive/2010/02/09/288177.html#1763711</link><dc:creator>且行且思</dc:creator><author>且行且思</author><pubDate>Tue, 09 Feb 2010 14:58:45 GMT</pubDate><guid>http://www.cnblogs.com/kriss/archive/2010/02/09/288177.html#1763711</guid><description><![CDATA[{System.Runtime.Remoting.RemotingException: TCP 信道协议冲突: 应为报头。
Server stack trace: 
   在 
System.Runtime.Remoting.Channels.Tcp.TcpSocketHandler.ReadVersionAndOperation
(UInt16&amp; operation)
   在 System.Runtime.Remoting.Channels.Tcp.TcpClientSocketHandler.ReadHeaders()
   在 System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage
(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, 
ITransportHeaders&amp; responseHeaders, Stream&amp; responseStream)
   在 
System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage
(IMessage msg)
Exception rethrown at [0]: 
   在 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage 
reqMsg, IMessage retMsg)
   在 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, 
Int32 type)
   在 Infowise.TCPMS.RemoteServiceLibrary.ClassCenterService.VerifyUser(Int32 
intStaff_Id, String strLog_Pwd, String strMac, String strLog, String strSysType)
   在 Infowise.TCPMS.PointTransactSys.ClassLogInfo.VerifyUser(String strId, String 
strPassword, String strVerision) 位置 C:\Documents and Settings\Administrator\桌面
\reflector5.0\Win\WindowsApplication1\WindowsApplication1\ClassLogInfo.cs:行号 236}

---------------------------------------
楼主遇见过类似这样的问题么？恳请指点一二。。

另props1[&quot;port&quot;] = 5001; 
我反编译一软件，这里是以16进制显示的，是否原因在于这？<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/kriss/" target="_blank">且行且思</a> 2010-02-09 22:58 <a href="http://www.cnblogs.com/kriss/archive/2010/02/09/288177.html#1763711#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Re:Remoting多个信道(Chennel)的注册问题</title><link>http://www.cnblogs.com/kriss/archive/2010/01/11/288177.html#1744174</link><dc:creator>ceopass</dc:creator><author>ceopass</author><pubDate>Mon, 11 Jan 2010 03:37:45 GMT</pubDate><guid>http://www.cnblogs.com/kriss/archive/2010/01/11/288177.html#1744174</guid><description><![CDATA[请教一个关于.NET REMOTING在一个客户端里连接两台服务器上的REMOTING服务的问题？
-----------------------------
就是B、C服务器上各运行一个REMOTING服务，在A服务器的一个应用程序里要同时去连接B、C服务器上的REMOTING服务（B、C服务器上提供的用户名和密码是不相同的），这个时候A服务器上应用程序的信道该如何注册呢？


我使用如下方法进行信道的注册

IDictionary channelA = new Hashtable();
channelA[&quot;name&quot;] = &quot;AServerChannel&quot;;
channelA[&quot;username&quot;] = &quot;AServerUserName&quot;;
channelA[&quot;password&quot;] = &quot;AServerPwd&quot;;

TcpClientChannel tA = new TcpClientChannel(channelA,new BinaryClientFormatterSinkProvider());
ChannelServices.RegisterChannel(tA,true);

//-----------------------------------
IDictionary channelB = new Hashtable();
channelB[&quot;name&quot;] = &quot;BServerChannel&quot;;
channelB[&quot;username&quot;] = &quot;BServerUserName&quot;;
channelB[&quot;password&quot;] = &quot;BServerPwd&quot;;

TcpClientChannel tB = new TcpClientChannel(channelB,new BinaryClientFormatterSinkProvider());
ChannelServices.RegisterChannel(tB,true);

这样可以在客户端上注册2个信道，但是在调试的时候只有A服务器可以连接，B服务器不能连接。好像只有第一个注册的信道有用，第二个注册的信道没有用一样！


请问，要怎么样，一个客户端才能使用多个信道连接不同的服务器？<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/kriss/" target="_blank">ceopass</a> 2010-01-11 11:37 <a href="http://www.cnblogs.com/kriss/archive/2010/01/11/288177.html#1744174#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Re:Remoting多个信道(Chennel)的注册问题</title><link>http://www.cnblogs.com/kriss/archive/2010/01/11/288177.html#1744171</link><dc:creator>ceopass</dc:creator><author>ceopass</author><pubDate>Mon, 11 Jan 2010 03:34:41 GMT</pubDate><guid>http://www.cnblogs.com/kriss/archive/2010/01/11/288177.html#1744171</guid><description><![CDATA[这样注册的两个TcpClientChannel有什么用呢？优先级都是1，只有第一个信道有用，第二个信道永远也不会被用上的啊！<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/kriss/" target="_blank">ceopass</a> 2010-01-11 11:34 <a href="http://www.cnblogs.com/kriss/archive/2010/01/11/288177.html#1744171#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Re:Remoting中的线程与网络通信内幕初探</title><link>http://www.cnblogs.com/kriss/archive/2009/11/19/288900.html#1702239</link><dc:creator>庄燚强</dc:creator><author>庄燚强</author><pubDate>Thu, 19 Nov 2009 04:21:59 GMT</pubDate><guid>http://www.cnblogs.com/kriss/archive/2009/11/19/288900.html#1702239</guid><description><![CDATA[[quote]AD：你的问题在于测试client程序里那个变量i是需要加锁的， 后面的分析基本和你的问题无关。&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://tingsaode.spaces.live.com/blog/cns&quot; target=&quot;_new&quot; rel=&quot;nofollow&quot;&gt;http://tingsaode.spaces.live.com/blog/cns&lt;/a&gt;!FE95D0EE01558610!419.entry&lt;br&gt;&lt;br&gt;但是你的精神很厉害啊， 而且在你的启发下， 我也靠抓包解决了我的问题。&lt;br&gt;[/quote]
是啊，要加锁 不然在多线程下 可能同时多为1 也有可能  呵呵   <br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/kriss/" target="_blank">庄燚强</a> 2009-11-19 12:21 <a href="http://www.cnblogs.com/kriss/archive/2009/11/19/288900.html#1702239#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Re:Remoting中的线程与网络通信内幕初探</title><link>http://www.cnblogs.com/kriss/archive/2009/11/19/288900.html#1702230</link><dc:creator>庄燚强</dc:creator><author>庄燚强</author><pubDate>Thu, 19 Nov 2009 04:13:13 GMT</pubDate><guid>http://www.cnblogs.com/kriss/archive/2009/11/19/288900.html#1702230</guid><description><![CDATA[如果是服务端只针对一个信道开辟一个线程去处理客户端请求，那么绝对是不够的呀，比如100个客户端注册的都是同一个信道，那么是否就说明这后面的99个请求要等待第一个请求执行完毕后才能再串行执行，显然ms不会这么去处理，而是即使在同一个信道中，服务端对于客户端的请求也是并发处理的，Soap（webservice，默认80端口&lt;类似Remoting的信道&gt;）中是使用线程池中的线程去处理客户端的请求的，至于Remoting，我想应该也是，而且楼主没有考虑Singlecall 和SingleTon的情况   而且既然是多线程处理就应要考虑锁的问题 ，可以使用锁的方式来进行测试与跟踪，或者答应出获取处理该请求，服务端所使用的当前线程ID，还有看下当前线程是否是后台线程，如果是后台线程，估计用的就是线程池了，应为Remoting的部署需要一个载体，也就是依赖的进程，每个进程独立的线程池！   <br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/kriss/" target="_blank">庄燚强</a> 2009-11-19 12:13 <a href="http://www.cnblogs.com/kriss/archive/2009/11/19/288900.html#1702230#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: ServU插件设计</title><link>http://www.cnblogs.com/kriss/archive/2009/07/04/104704.html#1575137</link><dc:creator>赵保龙</dc:creator><author>赵保龙</author><pubDate>Sat, 04 Jul 2009 02:22:32 GMT</pubDate><guid>http://www.cnblogs.com/kriss/archive/2009/07/04/104704.html#1575137</guid><description><![CDATA[你的图片弄得很好看啊，请问是用什么做的？photoshop 吗？<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/kriss/" target="_blank">赵保龙</a> 2009-07-04 10:22 <a href="http://www.cnblogs.com/kriss/archive/2009/07/04/104704.html#1575137#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 利用命名管道(Named Pipe)向Flash Player模拟Flash媒体文件</title><link>http://www.cnblogs.com/kriss/archive/2009/05/04/118763.html#1518917</link><dc:creator>VelvetMark</dc:creator><author>VelvetMark</author><pubDate>Mon, 04 May 2009 08:24:31 GMT</pubDate><guid>http://www.cnblogs.com/kriss/archive/2009/05/04/118763.html#1518917</guid><description><![CDATA[楼主在么？<br/>您的代码调试时卡在 API.ConnectNamedPipe(pipeHandle, ref lapped)这步一直没有反映，这是什么问题？<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/kriss/" target="_blank">VelvetMark</a> 2009-05-04 16:24 <a href="http://www.cnblogs.com/kriss/archive/2009/05/04/118763.html#1518917#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>
