source: src/test/java/geniusweb/examples/PythonDownloadProfile.py@ 24

Last change on this file since 24 was 24, checked in by bart, 4 years ago

some minor fixes

File size: 643 bytes
RevLine 
[24]1import time
2
3import com.neovisionaries.ws.client.WebSocketAdapter as WebSocketAdapter
4import com.neovisionaries.ws.client.WebSocketFactory as WebSocketFactory
5
6class PythonDownloadProfile(WebSocketAdapter):
7
8 def __init__(self):
9
10 factory = WebSocketFactory()
11 factory.setConnectionTimeout(5000)
12 ws = factory.createSocket("ws://localhost:8080/profilesserver/websocket/get/jobs/jobs1")
13 ws.addListener(self)
14
15 ws.connect()
16 time.sleep(2) # just briefly wait for possible updates
17 ws.disconnect()
18
19 def onTextMessage(self, websocket, json):
20 print "received message: "+json
Note: See TracBrowser for help on using the repository browser.