C# NamedPipeClientStream在应用程序服务中不工作
我的代码在我的服务器上运行良好,但在azure应用程序服务中,我收到此错误“操作已超时”。在C# NamedPipeClientStream在应用程序服务中不工作,c#,azure,pipe,C#,Azure,Pipe,我的代码在我的服务器上运行良好,但在azure应用程序服务中,我收到此错误“操作已超时”。在行中,在此处输入代码 pipeStream.Connect(TimeOut); 我的代码 public void Send(string SendStr, string PipeName, int TimeOut = 1000) { try { NamedPipeClientStream pipeStream = new NamedPip
行中,在此处输入代码
pipeStream.Connect(TimeOut);
我的代码
public void Send(string SendStr, string PipeName, int TimeOut = 1000)
{
try
{
NamedPipeClientStream pipeStream = new NamedPipeClientStream(".", PipeName, PipeDirection.Out, PipeOptions.Asynchronous);
// The connect function will indefinitely wait for the pipe to become available
// If that is not acceptable specify a maximum waiting time (in ms)
pipeStream.Connect(TimeOut);
Debug.WriteLine("[Client] Pipe connection established");
byte[] _buffer = Encoding.UTF8.GetBytes(SendStr);
pipeStream.BeginWrite(_buffer, 0, _buffer.Length, AsyncSend, pipeStream);
}
catch (TimeoutException oEX)
{
Debug.WriteLine(oEX.Message);
}
}
经过大量的工作,它几乎完全解决了我的问题
经过大量工作,它几乎完全解决了我的问题