https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 8d9511f490f0dc163cbc428a1fb63764b02b391e authored by Robin Berjon on 17 April 2014, 10:42:34 UTC
remove testing relying on detach() since that is now supposed to do nothing
Tip revision: 8d9511f
sleep_10_v13_wsh.py
#!/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)

back to top