Skip to content

Commit

Permalink
wslink 2017-07-25 (1d70dfac)
Browse files Browse the repository at this point in the history
Code extracted from:

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

at commit 1d70dfac217087632a51dd86f8ee9b1674487121 (master).
  • Loading branch information
kwrobot authored and aronhelser committed Aug 4, 2017
1 parent 721af5c commit 925ed7c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion python/src/wslink/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
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
Expand Down
5 changes: 4 additions & 1 deletion python/src/wslink/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 1 addition & 10 deletions python/src/wslink/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,6 @@ def __init__(self, *args, **kwargs):
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)
Expand All @@ -176,12 +172,6 @@ def setServerProtocol(self, newServerProtocol):
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

Expand Down Expand Up @@ -212,6 +202,7 @@ def connectionLost(self, reason):

class WslinkWebSocketServerProtocol(TimeoutWebSocketServerProtocol):
def __init__(self):
super(WslinkWebSocketServerProtocol, self).__init__()
self.functionMap = {}
self.attachmentMap = {}
self.attachmentId = 0
Expand Down

0 comments on commit 925ed7c

Please sign in to comment.