Lines Matching refs:fd
43 set fd [socket $server $port]
44 fconfigure $fd -translation binary
46 set ::redis::fd($id) $fd
70 set fd $::redis::fd($id)
73 if {$fd eq {}} {
77 set fd $::redis::fd($id)
95 ::redis::redis_write $fd $cmd
96 if {[catch {flush $fd}]} {
103 ::redis::redis_read_reply $id $fd
109 fileevent $fd readable [list ::redis::redis_readable $fd $id]
113 uplevel 1 [list ::redis::__method__$method $id $fd] $argv
117 proc ::redis::__method__blocking {id fd val} {
119 fconfigure $fd -blocking $val
122 proc ::redis::__method__reconnect {id fd val} {
126 proc ::redis::__method__read {id fd} { argument
127 ::redis::redis_read_reply $id $fd
130 proc ::redis::__method__write {id fd buf} {
131 ::redis::redis_write $fd $buf
134 proc ::redis::__method__flush {id fd} { argument
135 flush $fd
138 proc ::redis::__method__close {id fd} { argument
139 catch {close $fd}
151 proc ::redis::__method__channel {id fd} { argument
152 return $fd
155 proc ::redis::__method__deferred {id fd val} {
159 proc ::redis::redis_write {fd buf} {
160 puts -nonewline $fd $buf
163 proc ::redis::redis_writenl {fd buf} {
164 redis_write $fd $buf
165 redis_write $fd "\r\n"
166 flush $fd
169 proc ::redis::redis_readnl {fd len} {
170 set buf [read $fd $len]
171 read $fd 2 ; # discard CR LF
175 proc ::redis::redis_bulk_read {fd} { argument
176 set count [redis_read_line $fd]
178 set buf [redis_readnl $fd $count]
182 proc ::redis::redis_multi_bulk_read {id fd} { argument
183 set count [redis_read_line $fd]
189 lappend l [redis_read_reply $id $fd]
198 proc ::redis::redis_read_line fd { argument
199 string trim [gets $fd]
202 proc ::redis::redis_read_reply {id fd} { argument
203 set type [read $fd 1]
206 + {redis_read_line $fd}
207 - {return -code error [redis_read_line $fd]}
208 $ {redis_bulk_read $fd}
209 * {redis_multi_bulk_read $id $fd}
233 proc ::redis::redis_readable {fd id} {
234 if {[eof $fd]} {
236 ::redis::__method__close $id $fd
240 set line [gets $fd]
253 ::redis::redis_readable $fd $id
272 set data [read $fd $toread]