summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/websockets/handlers/sleep_10_v13_wsh.py
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/websockets/handlers/sleep_10_v13_wsh.py')
-rwxr-xr-xtesting/web-platform/tests/websockets/handlers/sleep_10_v13_wsh.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/testing/web-platform/tests/websockets/handlers/sleep_10_v13_wsh.py b/testing/web-platform/tests/websockets/handlers/sleep_10_v13_wsh.py
new file mode 100755
index 000000000..e1a6d9640
--- /dev/null
+++ b/testing/web-platform/tests/websockets/handlers/sleep_10_v13_wsh.py
@@ -0,0 +1,25 @@
+#!/usr/bin/python
+
+import sys, urllib, time
+from mod_pywebsocket import common, msgutil, util
+
+def web_socket_do_extra_handshake(request):
+ request.connection.write('x')
+ time.sleep(2)
+ request.connection.write('x')
+ time.sleep(2)
+ request.connection.write('x')
+ time.sleep(2)
+ request.connection.write('x')
+ time.sleep(2)
+ request.connection.write('x')
+ time.sleep(2)
+ return
+
+def web_socket_transfer_data(request):
+ while True:
+ line = msgutil.receive_message(request)
+ if line == 'Goodbye':
+ return
+ request.ws_stream.send_message(line, binary=False)
+