2010-02-09 175 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);