2010-02-09 177 views
4

我想写一个IBM的MQSeries主机与时关闭连接:IBM的MQSeries问题:远程主机写入消息(错误10054)

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选项?因为我不知道如何处理这些选项,我甚至不确定这是否是问题。

回答

3

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

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