Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/gwt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# AG-Softwate矩阵中无响应_C#_Wpf_Matrix_Xmpp - Fatal编程技术网

C# AG-Softwate矩阵中无响应

C# AG-Softwate矩阵中无响应,c#,wpf,matrix,xmpp,C#,Wpf,Matrix,Xmpp,我正在通过AG Softwate MatriX开发一个IM,我想实现登录操作,但是当我使用xmppClient.open()时,我无法接收帮助我接受证书的xml流 这是我在控制台中发送、接收或输出的xml: send:<stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="dodo.com" version="1.0" > rec:<stream:strea

我正在通过AG Softwate MatriX开发一个IM,我想实现登录操作,但是当我使用xmppClient.open()时,我无法接收帮助我接受证书的xml流

这是我在控制台中发送、接收或输出的xml:

send:<stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="dodo.com" version="1.0" >
rec:<stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" id="2543867956" from="dodo.com" version="1.0" xml:lang="en" >
'vivid.vshost.exe' (CLR v4.0.30319: vivid.vshost.exe): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.resources\v4.0_4.0.0.0_zh-Hans_b77a5c561934e089\System.resources.dll'. Module was built without symbols.
rec:<stream:features xmlns:stream="http://etherx.jabber.org/streams">
  <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
  <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
    <mechanism>PLAIN</mechanism>
    <mechanism>DIGEST-MD5</mechanism>
    <mechanism>SCRAM-SHA-1</mechanism>
  </mechanisms>
  <c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://www.process-one.net/en/ejabberd/" ver="k0acyvEdZQ7cl5uD5FTPoiOnuaw=" />
  <register xmlns="http://jabber.org/features/iq-register" />
</stream:features>
send:<starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
rec:<proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
发送:
记录:
“vivid.vshost.exe”(CLR v4.0.30319:vivid.vshost.exe):加载了“C:\Windows\Microsoft.Net\assembly\GAC\U MSIL\System.resources\v4.0\U 4.0.0.0\U zh-Hans\U b77a5c561934e089\System.resources.dll”。模块是在没有符号的情况下构建的。
记录:
平原
摘要-MD5
紧急停堆-SHA-1
发送:
记录:
我不知道为什么我的程序没有发送剩余的xml,您可以看到正确的xml流:

SEND: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="dodo.com" version="1.0" >
RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" id="3880372647" from="dodo.com" version="1.0" xml:lang="en" >
RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams">
  <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
  <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
    <mechanism>PLAIN</mechanism>
    <mechanism>DIGEST-MD5</mechanism>
    <mechanism>SCRAM-SHA-1</mechanism>
  </mechanisms>
  <c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://www.process-one.net/en/ejabberd/" ver="k0acyvEdZQ7cl5uD5FTPoiOnuaw=" />
  <register xmlns="http://jabber.org/features/iq-register" />
</stream:features>
SEND: <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
RECV: <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
SEND: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="dodo.com" version="1.0" >
RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" id="2091441686" from="dodo.com" version="1.0" xml:lang="en" >
RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams">
  <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
    <mechanism>PLAIN</mechanism>
    <mechanism>DIGEST-MD5</mechanism>
    <mechanism>SCRAM-SHA-1</mechanism>
  </mechanisms>
  <c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://www.process-one.net/en/ejabberd/" ver="k0acyvEdZQ7cl5uD5FTPoiOnuaw=" />
  <register xmlns="http://jabber.org/features/iq-register" />
</stream:features>
SEND: <auth mechanism="SCRAM-SHA-1" xmlns="urn:ietf:params:xml:ns:xmpp-sasl">biwsbj1pbWFjLHI9NmJkdG40NWdGbTNoYWJIR3JpdGdnOUdqT21yUDU0alA=</auth>
RECV: <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cj02YmR0bjQ1Z0ZtM2hhYkhHcml0Z2c5R2pPbXJQNTRqUGFqRWRPa0hKUGRCczl4aWMxN3lSeXc9PSxzPWowdHhSY0pnY0FaUkdYcnpCMUJydmc9PSxpPTQwOTY=</challenge>
SEND: <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">Yz1iaXdzLHI9NmJkdG40NWdGbTNoYWJIR3JpdGdnOUdqT21yUDU0alBhakVkT2tISlBkQnM5eGljMTd5Unl3PT0scD0weDZXcFJ1WG0vQzF5a3JIUXA1c2lBS2lpbzA9</response>
RECV: <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl">dj1CRitFMkdhcVZLYlRVeHpLbWxwVG82YVpDZzQ9</success>
SEND: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="dodo.com" version="1.0" >
RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" id="3562760347" from="dodo.com" version="1.0" xml:lang="en" >
RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams">
  <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind" />
  <session xmlns="urn:ietf:params:xml:ns:xmpp-session" />
  <sm xmlns="urn:xmpp:sm:2" />
  <sm xmlns="urn:xmpp:sm:3" />
  <c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://www.process-one.net/en/ejabberd/" ver="k0acyvEdZQ7cl5uD5FTPoiOnuaw=" />
  <register xmlns="http://jabber.org/features/iq-register" />
</stream:features>
SEND: <iq id="MX_1" type="set" xmlns="jabber:client">
  <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">
    <resource>MatriX</resource>
  </bind>
</iq>
RECV: <iq id="MX_1" type="result" xmlns="jabber:client">
  <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">
    <jid>imac@dodo.com/MatriX</jid>
  </bind>
</iq>
SEND: <iq id="MX_2" type="set" xmlns="jabber:client">
  <session xmlns="urn:ietf:params:xml:ns:xmpp-session" />
</iq>
RECV: <iq type="result" id="MX_2" xmlns="jabber:client" />
SEND: <iq id="MX_3" type="get" xmlns="jabber:client">
  <query xmlns="jabber:iq:roster" />
</iq>
RECV: <iq from="imac@dodo.com" to="imac@dodo.com/MatriX" id="MX_3" type="result" xmlns="jabber:client">
  <query xmlns="jabber:iq:roster">
    <item subscription="both" jid="test2@dodo.com">
      <group>EveryBody</group>
    </item>
    <item subscription="both" jid="123456@dodo.com">
      <group>EveryBody</group>
    </item>
    <item subscription="both" jid="macbook@dodo.com">
      <group>EveryBody</group>
    </item>
    <item subscription="both" jid="123457@dodo.com">
      <group>EveryBody</group>
    </item>
    <item subscription="both" jid="test3@dodo.com">
      <group>EveryBody</group>
    </item>
    <item subscription="both" jid="admin@dodo.com">
      <group>EveryBody</group>
    </item>
    <item subscription="both" jid="test4@dodo.com">
      <group>EveryBody</group>
    </item>
    <item subscription="both" jid="yj@dodo.com">
      <group>EveryBody</group>
    </item>
    <item subscription="both" jid="test@dodo.com">
      <group>EveryBody</group>
    </item>
    <item subscription="both" jid="yuanjiong@dodo.com">
      <group>EveryBody</group>
    </item>
    <item subscription="both" jid="taojiaen@dodo.com" />
    <item ask="subscribe" subscription="none" jid="taojiaen@163.com" />
  </query>
</iq>
SEND: <presence xmlns="jabber:client">
  <status></status>
  <priority>0</priority>
</presence>
RECV: <presence from="imac@dodo.com/MatriX" to="imac@dodo.com/MatriX" xmlns="jabber:client">
  <status />
  <priority>0</priority>
</presence>
发送:
记录:
记录:
平原
摘要-MD5
紧急停堆-SHA-1
发送:
记录:
发送:
记录:
记录:
平原
摘要-MD5
紧急停堆-SHA-1
发送:biwsbj1pbWFjLHI9NmJkdG40NWdGbTNoYWJIR3JpdGdnOUdqT21yUDU0alA=
记录:cj02YmR0bjQ1Z0ZtM2hhYkhHcml0Z2c5R2pPbXJQNTRqUGFqRWRPa0hKUGRCczl4aWMxN3lSeXc9PSxzPWowdHhSY0pnY0FaUkdYcnpCMUJydmc9PSxpPTQwOTY=
发送:YZ1IAXDZLHI9NMJKDG40NWDGBTNOYWJIR3JPDGDNOUDQT21YUDU0ALBHAKVKT2TILSBKQNM5EGLJMTD5UNL3PT0SCD0WEDZCFJ1WG0VQZF5A3JIUXA1C2LBS2LPZA9
记录:DJ1CRITFMKDHCVZLYLRVEHPLBWXWVG82YVPDZQ9
发送:
记录:
记录:
发送:
矩阵
记录:
imac@dodo.com/母体
发送:
记录:
发送:
记录:
每个人
每个人
每个人
每个人
每个人
每个人
每个人
每个人
每个人
每个人
发送:
0
记录:
0
正如您所看到的,由于我的程序没有发送正确的xml,我丢失了很多流 请帮我找到错误。

这是我的代码

        Config.NowXmppClient = new XmppClient();
        Config.NowXmppClient.ResolveSrvRecords = false;
        Config.NowXmppClient.SetXmppDomain("dodo.com");
        Config.NowXmppClient.Hostname = "123.456.789s.130";
        Config.NowXmppClient.Port= 5222;
const string LIC = @"eJxkkN1SgzAQhV+l470GHLXF2WZEpS2lYv+o08sIMUITAiGxwNPb2vp/s7O7
357dMwuTNKZ5RTu14HnVPyHstJIveksUveYHdIJhqmRiYu0neKFNkkpA3x2Y
GZLrVDfYBvSVw52ptBRUYQiJoNh7I9wQLRWgjxrupChI3nyCVOadoxVAnww8
QVKOK8JpdfPD2VmyGzqw3fDXoahIiKZeXaSK3u8yfG7Zl5ZjOYD+IfCreyok
1srsdh0L2Mff+gvb2uv/AFikLCfaKIq35cOwPb/yeMzasW8PMgcNuugqKpdW
MvBcq5mVt2vCellMrWw+Cdcuvy2WZIOcyaj2h342DcLQsdeBiJpX/mAHw17j
luEsImbKFs9hN2rV8Ok1HhdSsMA1o27LWW81mjxS/+V5U69UvSAoq5mTuyNn
Gyg2d8vHplHzrvZNQthyI9SgzcdP2z6gb9+A7wI=";
       Matrix.License.LicenseManager.SetLicense(LIC);

       Config.NowXmppClient.OnReceiveXml += new System.EventHandler<Matrix.TextEventArgs>(this.xmppClient_OnReceiveXml);
       Config.NowXmppClient.OnSendXml += new System.EventHandler<Matrix.TextEventArgs>(this.xmppClient_OnSendXml);
            //Config.NowXmppClient.OnStreamError += new System.EventHandler<Matrix.StreamErrorEventArgs>(this.xmppClient_OnStreamError);
       Config.NowXmppClient.OnValidateCertificate += new System.EventHandler<Matrix.CertificateEventArgs>(this.xmppClient_OnValidateCertificate);
       Config.NowXmppClient.OnLogin += new System.EventHandler<Matrix.EventArgs>(this.xmppClient_OnLogin);

    private void xmppClient_OnValidateCertificate(object sender, CertificateEventArgs e)
    {
        // always accept cert
        e.AcceptCertificate = true;
        StackFrame[] stacks = new StackTrace().GetFrames();
        Console.Write(ToString(stacks));

        // or let the user validate the certificate
        // ValidateCertificate(e);
    }

    private void xmppClient_OnLogin(object sender, Matrix.EventArgs e)
    {
        Console.WriteLine("OnLogin");
    }

    private void xmppClient_OnReceiveXml(object sender, TextEventArgs e)
    {
        Console.WriteLine("rec:" + e.Text);
    }


    private void xmppClient_OnSendXml(object sender, TextEventArgs e)
    {
        Console.WriteLine("send:" + e.Text);
    }
Config.NowXmppClient=new XmppClient();
Config.NowXmppClient.ResolveSrvRecords=false;
Config.NowXmppClient.SetXmppDomain(“dodo.com”);
Config.NowXmppClient.Hostname=“123.456.789s.130”;
Config.NowXmppClient.Port=5222;
常量字符串LIC=@“eJxkkN1SgzAQhV+l470GHLXF2WZEpS2lYv+o08sIMUITAiGxwNPb2vp/s7O7
357DMWUTNKZ5RTU14HNPYHSTJIVEKSUVEYHDIJHQMRIYU0NEKFNKKPA3X2Y
GZLRVDFYBVSVW52PTBRUYQIJONH7I9WQLRWGJXRUPCHI3NYCVOADOXVANW8
QVKOK8JpdfPD2VmyGzqw3fDXoahIiKZeXaSK3u8yfG7Zl5ZjOYD+IfCreyok
1srsdh0L2Mff+gvb2uv/AFikLCfaKIq35cOwPb/yeMzasW8PMgcNuugqKpdW
MvBcq5mVt2vCellMrWw+Cdcuvy2WZIOcyaj2h342DcLQsdeBiJpX/mAHw17j
LUESIMBKFS9HN2RV8OK1HHDSSMA1O27LW81MJXS/+V5U69UvSAoq5mTuyNn
Gyg2d8vHplHzrvZNQthyI9SgzcdP2z6gb9+A7wI=“;
矩阵.License.LicenseManager.SetLicense(LIC);
Config.NowXmppClient.OnReceiveXml+=new System.EventHandler(this.xmppClient\u OnReceiveXml);
Config.NowXmppClient.OnSendXml+=new System.EventHandler(this.xmppClient_OnSendXml);
//Config.NowXmppClient.OnStreamError+=new System.EventHandler(this.xmppClient\u OnStreamError);
Config.NowXmppClient.OnValidateCertificate+=new System.EventHandler(this.xmppClient\u OnValidateCertificate);
Config.NowXmppClient.OnLogin+=new System.EventHandler(this.xmppClient\u OnLogin);
私有void xmppClient_OnValidateCertificate(对象发送方、CertificateEventArgs e)
{
//始终接受证书
e、 AcceptCertificate=true;
StackFrame[]stacks=new StackTrace().GetFrames();
Console.Write(ToString(stacks));
//或者让用户验证证书
//验证证书(e);
}
私有void xmppClient_OnLogin(对象发送方,Matrix.EventArgs e)
{
Console.WriteLine(“OnLogin”);
}
私有void xmppClient_OnReceiveXml(对象发送方,TextEventArgs e)
{
Console.WriteLine(“rec:+e.Text”);
}
私有void xmppClient_OnSendXml(对象发送方,TextEventArgs e)
{
Console.WriteLine(“发送:+e.Text”);
}

有人帮忙吗

您的TLS服务器证书似乎有问题。 尝试安装正确的服务器证书或尝试在没有TLS的情况下连接

Config.NowXmppClient.StartTls = false;