From: <aku...@sh...> - 2015-04-17 07:03:19
|
Automated mail by fx, on behalf of aku...@sh... Ticket Change [0cd18e8fd5fb90c68b1a963abe7390a6e05abf14] [Ticket [631a44ed66fbb333|631a44ed66] WebSocket clients can block server status still Open with 3 other changes] By anonymous For Tcl Library Source Code On 2015-04-17T06:48:13.972 Details http://core.tcl.tk/tcllib/tinfo?name=0cd18e8fd5fb90c68b1a963abe7390a6e05abf14 Ticket http://core.tcl.tk/tcllib/tktview/631a44ed66fbb33373f1d5342a0ae5d1ba6dd38b Changed Fields icomment: A recipe for a client blocking the server by refusing to read: ---------------->8---------------- package require websocket; namespace eval ::s {}; proc ::s::accept {sock args} { puts "server: new connection $args"; ::websocket::takeover $sock [list ::s::handler] 1 {}; ::websocket::send $sock text [string repeat "Welcome" 1000000]; } proc ::s::handler {sock type args} { puts "$sock: $type $args"; } proc ::s::canary {interval} { puts "canary: Still alive..."; ::after $interval [list ::s::canary $interval]; } ::s::canary 1000; ::socket -server [list ::s::accept] 54321; ----------------8<---------------- In the second shell run the following command: ---------------->8---------------- nc localhost 54321 | { sleep 5s; wc; } ----------------8<---------------- login: anonymous ------------------------------------------------------------ See Tcl/Tk development @ http://core.tcl.tk/ ------------------------------------------------------------ |