Posted to tcl by gps at Thu Mar 12 08:00:41 GMT 2009view raw
- #Server
- proc get sock {
- puts $sock [string repeat "LONG DATA" 2000]
- flush $sock
- }
- proc accept {sock args} {
- fconfigure $sock -blocking 0
- fileevent $sock readable [list get $sock]
- }
- socket -server accept 8888
- vwait forever
- #Client
- set s [socket localhost 8888]
- while 1 {
- puts $s "SEND"
- }