如何删除Tsung的名册联系人?

时间:2011-11-17 10:07:43

标签: erlang xmpp tsung

我在删除Tsung的名册联系方面遇到了问题。我试着问他们,但没有人回复我的邮件。我的配置(.xml)中的所有内容都与他们的文档类似,但只添加联系人正在工作,重命名和删除不起作用。这是我的会话代码:

<session bidi="true" probability="100" name="AddRoster" type="ts_jabber">
    <request> <jabber type="connect" ack="local"></jabber> </request>
    <transaction name="authenticate">
        <request> <jabber type="auth_sasl" ack="local"></jabber> </request>
        <request> <jabber type="connect" ack="local"></jabber> </request>
        <request> <jabber type="auth_sasl_bind" ack="local" ></jabber></request>
        <request> <jabber type="auth_sasl_session" ack="local" ></jabber></request>
    </transaction>
    <thinktime value="2"></thinktime>
    <request> <jabber type="iq:roster:get" ack="local"/> </request>
    <thinktime value="2"></thinktime>
    <request> <jabber type="presence:initial" ack="no_ack"/> </request>
    <thinktime value="40"></thinktime>
    <for from="1" to="100" incr="1" var="counter">
        <transaction name="add_roster">
                <request> <jabber type="iq:roster:add" ack="no_ack" destination="online"> </jabber> </request>
                <request> <jabber type="presence:subscribe" ack="no_ack"/> </request>
            </transaction>
    </for>
    <for from="1" to="50" incr="1" var="counter">
        <transaction name="rosterrename">
                <request> <jabber type="iq:roster:rename" ack="no_ack"></jabber> </request>
            </transaction>
    </for>
    <for from="1" to="100" incr="1" var="counter">
            <transaction name="rosterdelete">
                <request> <jabber type="iq:roster:remove" ack="no_ack"></jabber> </request>
            </transaction>
    </for>
    <thinktime value="400"></thinktime>
    <request> <jabber type="presence:final" ack="no_ack"/> </request>
    <thinktime value="1"></thinktime>
    <request> <jabber type="close" ack="local"></jabber> </request>
</session>

1 个答案:

答案 0 :(得分:0)

在Tsung的文件上方http://tsung.erlang-projects.org/user_manual.html#htoc58,我猜你的问题是由三个for循环引起的!

您可以尝试这样:

<for from="1" to="50" incr="1" var="counter">

<transaction name="rosteradd">
  <request>
    <jabber type="iq:roster:add" ack="no_ack" destination="online"></jabber>
  </request>
  <request>
    <jabber type="presence:subscribe" ack="no_ack"/>
  </request>
</transaction>

<!-- ... -->

<transaction name="rosterrename">
  <request> <jabber type="iq:roster:rename" ack="no_ack"></jabber> </request>
</transaction>

<!-- ... -->

<transaction name="rosterdelete">
  <request> <jabber type="iq:roster:remove" ack="no_ack"></jabber> </request>
</transaction>

</for>

因为Tsung有自己的背景!因此,如果您在不同的循环中添加/重命名/删除,则上下文也不同。只需在一个循环中执行该事务!