Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: da8edd91ee
Fetching contributors…

Cannot retrieve contributors at this time

28 lines (21 sloc) 0.82 kB
# __BEGIN_LICENSE__
# Copyright (C) 2008-2010 United States Government as represented by
# the Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# __END_LICENSE__
from Dispatcher import Dispatcher
import exampleConfig
def handleConnect(sock):
print 'got connection'
def handleLine(sock, line):
print 'got:', line
sock.write('ciao\n')
com = Dispatcher(moduleName='exampleServer')
if exampleConfig.NOTIFY_ENDPOINT:
com.connectToNotificationService(exampleConfig.NOTIFY_ENDPOINT)
com.listen(exampleConfig.SERVER_ENDPOINT,
connectHandler=handleConnect,
lineHandler=handleLine)
if exampleConfig.USE_SERVICE_DISCOVERY:
com.findServices(protoName=exampleConfig.PROTOCOL, announceServices=[exampleConfig.SERVER_ENDPOINT])
com.runForever()
Jump to Line
Something went wrong with that request. Please try again.