[Tsung] jabber 2-way communication?

Nicolas Niclausse nicolas at niclux.org
Thu Oct 19 09:32:01 CEST 2006


Jason Tucker ecrivait le 11.10.2006 21:34:
> Question for the tsung gurus:
> 
> Would it be technically feasible to allow a tsung client to recognize
> and respond to specific data that is received during a think state?
> Essentially, this would allow for 2-way communication between seperate
> client endpoints - for example, if ClientA receives a presence
> "subscribe" request from ClientB, ClientA could then reply with a
> "subscribed" response, completing the subscription.
> 
> I know how to identify the interesting packets as they come in, I'm just
> now sure how to go about getting the reponses sent back on the wire. Is
> this even possible?

I think it should be possible to add a new parameter for a protocol:
bidirectional (true or false).

If true, packets received in 'think' state could be send to a fun called
'parse_bidi' that should be implemented by bidirectional plugins.

something like (for Jabber):

ts_jabber:parse_bidi(Data, State)

You can send a packet back to the server in this function, or the fun could
return something like {{data, Response}, NewState}

I'll try to implement something like that in the svn

-- 
Nicolas


More information about the Tsung-users mailing list