source: doc/examples/ping_component.tac @ 251:554782284e08

Last change on this file since 251:554782284e08 was 65:6936acbdb9bd, checked in by Ralph Meijer <ralphm@…>, 11 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: 686 bytes
Line 
1"""
2An XMPP Ping server as an external server-side component.
3
4This ping server assumes the domain C{'ping'}.
5"""
6
7from twisted.application import service
8from wokkel import component
9from wokkel.ping import PingHandler
10
11# Configuration parameters
12
13EXT_HOST = 'localhost'
14EXT_PORT = 5347
15SECRET = 'secret'
16DOMAIN = 'ping'
17LOG_TRAFFIC = True
18
19
20# Set up the Twisted application
21
22application = service.Application("Ping Component")
23
24router = component.Router()
25pingComponent = component.Component(EXT_HOST, EXT_PORT, DOMAIN, SECRET)
26pingComponent.logTraffic = LOG_TRAFFIC
27pingComponent.setServiceParent(application)
28
29pingHandler = PingHandler()
30pingHandler.setHandlerParent(pingComponent)
Note: See TracBrowser for help on using the repository browser.