DebugClients/Ruby/AsyncFile.rb

changeset 2987
c99695c0f13a
parent 2438
61bfcff921d8
child 3160
209a07d7e401
equal deleted inserted replaced
2986:cd4e2cab7eb2 2987:c99695c0f13a
82 @wpending = @wpending[sent..-1] 82 @wpending = @wpending[sent..-1]
83 @nWriteErrors = 0 83 @nWriteErrors = 0
84 rescue IOError 84 rescue IOError
85 @nWriteErrors += 1 85 @nWriteErrors += 1
86 if @nWriteErrors > self.maxtries 86 if @nWriteErrors > self.maxtries
87 raise # assume that an error that occurs 10 times wont go away 87 raise
88 # assume that an error that occurs 10 times wont go away
88 end 89 end
89 end 90 end
90 end 91 end
91 end 92 end
92 93
281 if @wpending.length == 0 282 if @wpending.length == 0
282 @wpending = s.dup 283 @wpending = s.dup
283 elsif @wpending.length + s.length > @@maxbuffersize 284 elsif @wpending.length + s.length > @@maxbuffersize
284 # flush wpending if too big 285 # flush wpending if too big
285 while @wpending.length > 0 286 while @wpending.length > 0
286 # if we have a persistent error in sending the data, an exception 287 # if we have a persistent error in sending the data, an
287 # will be raised in nWrite 288 # exception will be raised in nWrite
288 flush 289 flush
289 tries += 1 290 tries += 1
290 if tries > @@maxtries 291 if tries > @@maxtries
291 raise IOError, "Too many attempts to send data" 292 raise IOError, "Too many attempts to send data"
292 end 293 end

eric ide

mercurial