[英].NET remoting client and server on the same computer. One process? Two processes?
[英].NET Remoting Server Only processes One request
我正在使用.NET Remoting。 我的服務器/主機是Windows服務。 有時它會正常工作,而其他時候它將處理一個請求,然后不再處理(直到我重新啟動它)。 它作為Windows服務運行。這是Windows服務中的代碼:
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類型,將為客戶端進行的每個調用創建SampleObject。 這向我表明您的對象有問題,並且您沒有顯示它的作用。 您需要查看它對共享資源orlock的任何依賴關系。 嘗試在SampleObject的構造函數中編寫一些調試信息,以查看遠程調用能達到的程度。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.