Commit 925ed7c9 authored by wslink Upstream's avatar wslink Upstream Committed by Aron Helser
Browse files

wslink 2017-07-25 (1d70dfac)

Code extracted from:

    https://github.com/Kitware/wslink.git

at commit 1d70dfac217087632a51dd86f8ee9b1674487121 (master).
parent 721af5c6
......@@ -34,7 +34,7 @@ to the point-to-point communication we actually use.
* `cd ../python`
* `python examples/webserver.py`
- starts a webserver at [localhost](http://localhost:8080/) with buttons to test RPC and pub/sub methods
* `python examples/simple.py --content client/www`
* `python examples/simple.py --content ../js/dist/examples`
- starts the same example using the configurable server
## Testing
......
......@@ -5,7 +5,7 @@ javascript client over a websocket.
wslink.server creates the python server
wslink.websocket handles the communication
"""
__version__ = '0.1.2'
__version__ = '0.1.3'
__license__ = 'BSD-3-Clause'
from .uri import checkURI
......
......@@ -160,7 +160,10 @@ def start_webserver(options, protocol=wsl.ServerProtocol, disableLogging=False):
observer.start()
# log.startLogging(sys.stdout)
# Set logging level.
if (options.debug): logging.basicConfig(level=logging.DEBUG)
if (options.debug):
logging.basicConfig(level=logging.DEBUG)
else:
logging.basicConfig(level=logging.ERROR)
contextFactory = None
......
......@@ -148,10 +148,6 @@ class TimeoutWebSocketServerFactory(WebSocketServerFactory):
WebSocketServerFactory.__init__(self, *args, **kwargs)
WebSocketServerFactory.protocol = TimeoutWebSocketServerProtocol
def startFactory(self):
# this is only called if the WsSite factory isn't created first.
log.msg("wslink: Starting factory", logLevel=logging.CRITICAL)
def connectionMade(self):
if self._reaper:
log.msg("Client has reconnected, cancelling reaper", logLevel=logging.DEBUG)
......@@ -176,12 +172,6 @@ class TimeoutWebSocketServerFactory(WebSocketServerFactory):
def getServerProtocol(self):
return self._protocolHandler
### Does not seem to work to print a "ready line"
# def startFactory(self):
# sys.stdout.write("wslink: Starting factory\n")
# sys.stdout.flush()
# WebSocketServerFactory.startFactory(self)
def getClientCount(self):
return self.clientCount
......@@ -212,6 +202,7 @@ CLIENT_ERROR = -32099
class WslinkWebSocketServerProtocol(TimeoutWebSocketServerProtocol):
def __init__(self):
super(WslinkWebSocketServerProtocol, self).__init__()
self.functionMap = {}
self.attachmentMap = {}
self.attachmentId = 0
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment