2008-09-17 9 views
0

.NET Remotingを使用しています。私のサーバー/ホストはWindowsサービスです。それはときどきうまくいき、ある要求を処理してからそれ以上処理しない(再起動するまで)。 Windowsサービスとして実行されています。Windowsサービスのコードは次のとおりです。.NET Remotingサーバー1つの要求のみを処理します。

using System; 
    using System.Collections.Generic; 
    using System.ComponentModel; 
    using System.Data; 
    using System.Diagnostics; 
    using System.Linq; 
    using System.Runtime.Remoting; 
    using System.Runtime.Remoting.Channels; 
    using System.Runtime.Remoting.Channels.Tcp; 
    using System.ServiceProcess; 
    using System.Text; 
    using Remoting; 

    namespace CreateReview 
    { 
     public partial class Service1 : ServiceBase 
     { 
      public Service1() 
      { 
       InitializeComponent(); 
      } 

      readonly TcpChannel channel = new TcpChannel(8180); 

      protected override void OnStart(string[] args) 
      { 
       // Create an instance of a channel 
       ChannelServices.RegisterChannel(channel, false); 

       // Register as an available service with the name HelloWorld 
       RemotingConfiguration.RegisterWellKnownServiceType(
        typeof(SampleObject), 
        "SetupReview", 
        WellKnownObjectMode.SingleCall); 
      } 

      protected override void OnStop() 
      { 

      } 
     } 
    } 

ありがとうございました。 SingleCall型としてVaccano

答えて

1

は、あなたのSampleObjectは、すべてのクライアントが行う呼び出し用に作成されます。これは、あなたのオブジェクトが間違っていることを私に示唆し、あなたはそれが何をしているかを示さない。あなたは、共有されたリソースまたはロックに依存していることを確認する必要があります。 SampleObjectのコンストラクタにいくつかのデバッグを書き出して、リモート呼び出しがどのくらい離れているかを確認してください。

関連する問題