Last change
on this file since 238:a2a4310ded26 was
65:6936acbdb9bd,
checked in by Ralph Meijer <ralphm@…>, 13 years ago
|
Add support for the XMPP Ping protocol.
Author: ralphm
Fixes #55.
This adds a whole bunch of examples around the ping protocol in different
settings for both the pinger and pingee: as a external server-side component,
as a standalone server with server-to-server connectivity and as a client.
Also updates the disco support to allow for non-deferred responses from
subprotocol handlers
|
File size:
792 bytes
|
Line | |
---|
1 | """ |
---|
2 | An XMPP Ping client as an external server-side component. |
---|
3 | |
---|
4 | This pinger client assumes the domain C{pinger}. |
---|
5 | """ |
---|
6 | |
---|
7 | from twisted.application import service |
---|
8 | from twisted.words.protocols.jabber.jid import JID |
---|
9 | from wokkel import component |
---|
10 | from pinger import Pinger |
---|
11 | |
---|
12 | # Configuration parameters |
---|
13 | |
---|
14 | EXT_HOST = 'localhost' |
---|
15 | EXT_PORT = 5347 |
---|
16 | SECRET = 'secret' |
---|
17 | DOMAIN = 'pinger' |
---|
18 | OTHER_DOMAIN = 'ping' |
---|
19 | LOG_TRAFFIC = True |
---|
20 | |
---|
21 | |
---|
22 | # Set up the Twisted application |
---|
23 | |
---|
24 | application = service.Application("Pinger Component") |
---|
25 | |
---|
26 | router = component.Router() |
---|
27 | pingerComponent = component.Component(EXT_HOST, EXT_PORT, DOMAIN, SECRET) |
---|
28 | pingerComponent.logTraffic = LOG_TRAFFIC |
---|
29 | pingerComponent.setServiceParent(application) |
---|
30 | |
---|
31 | pingerHandler = Pinger(JID(OTHER_DOMAIN), JID(DOMAIN)) |
---|
32 | pingerHandler.setHandlerParent(pingerComponent) |
---|
Note: See
TracBrowser
for help on using the repository browser.