libipc-examples/crystal/src/fromipc.cr

8 lines
180 B
Crystal

# Read an IPC network packet and remove the first 4 bytes.
buffer = Bytes.new 1_000_000
while true
len = STDIN.read buffer
break if len == 0
STDOUT.write buffer[4.. len -1]
end