comparison net.rhope @ 166:1bfc19076f1b

Merge
author Mike Pavone <pavone@retrodev.com>
date Thu, 10 Mar 2011 04:16:38 +0000
parents 47ab97730865 429afd920a23
children
comparison
equal deleted inserted replaced
165:47ab97730865 166:1bfc19076f1b
307 307
308 Write@TCP Connection[con,buffer(Array):out,err] 308 Write@TCP Connection[con,buffer(Array):out,err]
309 { 309 {
310 If[[buffer]Length] 310 If[[buffer]Length]
311 { 311 {
312 out,err <- [con]_Write[buffer,0] 312 If[[Raw Size[[buffer]Eltype >>]] > [1]]
313 {
314 bytelen <- [[buffer]Length]*[Raw Size[[buffer]Eltype >>]]
315 //Copy to a byte buffer until we have a better way of writing from an arbitrary byte offset
316 bbuffer <- [_internal_array_copychunk[buffer, 0, _internal_array_allocnaked[bytelen, UInt8()], 0, [buffer]Length]]Length <<[bytelen]
317 }{
318 bbuffer <- Val[buffer]
319 }
320 out,err <- [con]_Write[bbuffer,0]
313 }{ 321 }{
314 out <- con 322 out <- con
315 } 323 }
316 } 324 }
317 325
390 buflist <- () 398 buflist <- ()
391 } 399 }
392 ,out con,err <- [[con]Read Buffer <<[Array[]]]_Read[ntoread,buflist] 400 ,out con,err <- [[con]Read Buffer <<[Array[]]]_Read[ntoread,buflist]
393 { data <- _Merge Buffers[~] } 401 { data <- _Merge Buffers[~] }
394 } 402 }
403 }
404 }
405
406 Read Type@TCP Connection[con,toread(Int32),type(Blueprint):data,out con,err]
407 {
408 toreadbytes <- [toread]*[Raw Size[type]]
409 ,out con,err <- [con]Read[toreadbytes]
410 {
411 data <- [_internal_array_copychunk[~, 0, _internal_array_allocnaked[toread, type], 0, toreadbytes]]Length <<[toread]
395 } 412 }
396 } 413 }
397 414
398 _Check Partial[buffer,delim,offset:partial,none] 415 _Check Partial[buffer,delim,offset:partial,none]
399 { 416 {