简体   繁体   English

“已超过服务器实例的最大数量”是什么意思?

[英]What does "The maximum number of server instances has been exceeded" mean?

System.IO.Pipes.NamedPipeServerStream class throws IOException and the documentation says The maximum number of server instances has been exceeded. System.IO.Pipes.NamedPipeServerStream 类抛出 IOException 并且文档说已超过最大服务器实例数。 This message is not very clear to me.这个消息对我来说不是很清楚。 Can someone explain it in terms of I can understand?有人可以用我能理解的方式解释它吗? Does it mean that the same code is being executed by two different processes or something like that?这是否意味着两个不同的进程或类似的东西正在执行相同的代码? How can I avoid it if it happens rarely?如果很少发生,我该如何避免?

I am using the following constructor:我正在使用以下构造函数:

int maxNumberServerInstance = 1;
new NamedPipeServerStream(name, PipeDirection.InOut, maxNumberServerInstance , PipeTransmissionMode.Message, PipeOptions.None, bufferSize, bufferSize, pipeSecurity);

I get IOException.我得到 IOException。

Let's visit the documentation.让我们访问文档。

NamedPipeServerStream Class NamedPipeServerStream 类

Exceptions例外

IOException The maximum number of server instances has been exceeded. IOException已超出服务器实例的最大数量。

NamedPipeServerStream.MaxAllowedServerInstances Field NamedPipeServerStream.MaxAllowedServerInstances 字段

Represents the maximum number of server instances that the system resources allow.表示系统资源允许的最大服务器实例数。

Remarks评论

Use the MaxAllowedServerInstances when creating a NamedPipeServerStream object to set the maximum number of server instances that the system resources allow.在创建 NamedPipeServerStream 对象时使用 MaxAllowedServerInstances 来设置系统资源允许的最大服务器实例数。

In short the error is telling you that the maximum amount of instances has been created.简而言之,错误告诉您已经创建了最大数量的实例。

You will get this if you have used the default constructor with just the name, additionally you will get a pipe with the following characteristics:如果您仅使用带有名称的默认构造函数,您将获得此信息,此外,您还将获得一个具有以下特征的管道:

  • A default pipe direction of InOut. InOut 的默认管道方向。

  • The maximum number of server instances that share the same name set to 1.共享相同名称的最大服务器实例数设置为 1。

  • A PipeTransmissionMode value of Byte. Byte 的 PipeTransmissionMode 值。

  • A PipeOptions value of None.无的 PipeOptions 值。

  • Default input and output buffer sizes.默认输入和输出缓冲区大小。

  • No pipe security.没有管道安全。

  • A HandleInheritability value of None. None 的 HandleInheritability 值。

  • No specified additional PipeAccessRights.没有指定额外的 PipeAccessRights。

At minimum you would want to use the following constructor if you need more than one instance:如果需要多个实例,至少需要使用以下构造函数:

NamedPipeServerStream(String, PipeDirection, Int32) NamedPipeServerStream(String, PipeDirection, Int32)

Parameters参数

  • pipeName String管道名称String

    • The name of the pipe.管道的名称。
  • direction PipeDirection方向PipeDirection

    • One of the enumeration values that determines the direction of the pipe.确定管道方向的枚举值之一。
  • maxNumberOfServerInstances Int32 maxNumberOfServerInstances Int32

    • The maximum number of server instances that share the same name.共享相同名称的服务器实例的最大数量。 You can pass MaxAllowedServerInstances for this value.您可以为此值传递 MaxAllowedServerInstances。

Lastly, if you are getting this error and you have only one instance, you probably have a subtle problem with how you are creating them.最后,如果您收到此错误并且您只有一个实例,则您的创建方式可能存在微妙的问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 “已超过最大错误数”,但未列出任何错误或警告 - “maximum number of errors has been exceeded” but no errors nor warnings listed 已超出传入邮件的最大邮件大小限额(65536) - The maximum message size quota for incoming messages (65536) has been exceeded SmtpClient:最大并发连接数超过了限制 - SmtpClient: The maximum number of concurrent connections has exceeded a limit WCF错误:System.ServiceModel.CommunicationException已超过传入消息的最大消息大小配额 - WCF error: System.ServiceModel.CommunicationException the maximum message size quota for incoming messages has been exceeded 错误:外部DLL已超过传入消息的最大消息大小配额(65536) - Error: maximum message size quota for incoming messages (65536) has been exceeded from external DLL WCF,已超过传入消息的最大消息大小配额(65536) - WCF, The maximum message size quota for incoming messages (65536) has been exceeded 读取XML数据时已超出最大名称字符集计数配额(16384) - The maximum nametable character count quota (16384) has been exceeded while reading XML data 即使增加maxReceivedMessageSize,也超出了传入消息的最大消息大小配额(65536) - The maximum message size quota for incoming messages (65536) has been exceeded even after increasing maxReceivedMessageSize WCF:读取XML数据时已超出最大数组长度配额(16384) - WCF: The maximum array length quota (16384) has been exceeded while reading XML data WCF-读取XML数据时超出了最大字符串内容长度配额(8192) - WCF - The maximum string content length quota (8192) has been exceeded while reading XML data
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM