gpt4 book ai didi

c# - IBM MQSeries 问题 : remote host closes connection when writing message (error 10054)

转载 作者:行者123 更新时间:2023-11-30 12:18:26 25 4
gpt4 key购买 nike

我正在尝试写入 IBM MQSeries 主机:

public void WriteMessage(string message)
{
queueMessage = new MQMessage();
queueMessage.WriteString(message);
queueMessage.Format = MQC.MQFMT_STRING;
queuePutMessageOptions = new MQPutMessageOptions();

queue.Put(queueMessage, queuePutMessageOptions);
}

但是我的 errorcatch 给了我一个错误:

Error in the application

当然,这并没有显示太多。所以我检查了服务器上的事件日志,这向我显示了错误:

An error occurred receiving data from stx041774 (192.168.225.51) over TCP/IP. This may be due to a communications failure.

The return code from the TCP/IP (recv) call was 10054 (X'2746').

Record these values and tell the systems administrator.

我查了一下 10054,意思是:

An existing connection was forcibly closed by the remote host.

有人知道我可以做些什么来完成这项工作吗?也许我必须为写作设置一个 MQC 选项?因为我不知道如何处理这些选项,所以我什至不确定这是否是问题所在。

最佳答案

我用选项 mqc.mqoo_output 解决了这个问题:

queue = qManager.AccessQueue(QueueName, MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING);

关于c# - IBM MQSeries 问题 : remote host closes connection when writing message (error 10054),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2227907/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com