'input2ipc' and 'fromipc' handle multiple messages.
parent
39fc84934d
commit
d187d02de7
|
@ -1,4 +1,7 @@
|
|||
# Read an IPC network packet and remove the first 4 bytes.
|
||||
buffer = Bytes.new 1_000_000
|
||||
len = STDIN.read buffer
|
||||
STDOUT.write buffer[4.. len -1]
|
||||
while true
|
||||
len = STDIN.read buffer
|
||||
break if len == 0
|
||||
STDOUT.write buffer[4.. len -1]
|
||||
end
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
buffer = Bytes.new 1_000_000
|
||||
while true
|
||||
len = STDIN.read buffer
|
||||
break if len == 0
|
||||
STDOUT.write_bytes len, IO::ByteFormat::BigEndian
|
||||
STDOUT.write buffer[0.. len -1]
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue