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 |