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

Last change on this file since 29 was 29, checked in by bart, 3 years ago

Added SAOP and simplerunner to GeniusWebPython. Several minor fixes.

File size: 643 bytes
Line 
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.