Skip to content

Instantly share code, notes, and snippets.

@DexterHaslem
Created November 11, 2013 23:53
Show Gist options
  • Save DexterHaslem/7422746 to your computer and use it in GitHub Desktop.
Save DexterHaslem/7422746 to your computer and use it in GitHub Desktop.
set s [socket "localhost" 36973]
set done false
set chunk ""
set count 0
while {!$done} {
set char [read $s 1]
if {$char == "\0"} {
puts $chunk
set chunk ""
incr count
if {$count == 3} {
break
}
} else {
append chunk $char
}
}
puts "done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment